Tiny Core Base > Raspberry Pi
USB gadget kernel module with RPi zero
ladnar:
Rich, I will take that under advisement. I am already swimming deep over my head. I better tread water, float, and catch my breath.
Still going over johannkraus' successful attempt, and his and the community's help getting Linkan to have succesful g_ether. Maybe my mistakes will be revealed?
But bot was still having problems when I first popped on this thread, so I am guessing whatever the solution is, its not well documented.
(I wonder if there is a software way to tell which USB port on a pi-zero is drawing the power? Anybody have a command for that? I guess i could use my USB voltmeter-ammeter; ideally, I would need two or four volt-ammeters for proper experiments?)
Anyway, I am on JK's second message, about where he says RTFM; OI will do that. And follow his advice:
--- Quote --- "I copied dwc2 and the gadget modules to lib/modules/.../usb and also copied modules.dep " .I assume depmod -a should be better than copying modules.dep
--- End quote ---
depmod -a should create the modules.dep file ; maybe copying it into the directory skips an important step? I'll make certain that is done and then make the results persistent. And then read some more!
ladnar:
OK, apparently I didn't make the loaded modules (all 1900+ .ko files) persistent?
If I run depomod -a, the modules.dep file goes from having 1500+ entries back down to 180+ entries?
When I reboot, modules.dep goes back up to 1500+ entries (I made that persistent, at least!). I guess I can count the ,ko files in the /lib/modules/4.9.22-piCore directory? There's a command for that, if I can remember it / find it?
If there are 1900+ .ko files, I can install/configure them all? Or is this overkill?
modules.dep says g_ether only needs four files: usb_f_rndis.ko , libcomposite.ko , u_ether.ko , udc-core.ko
I dunno. read more manuals? Learn how to configure the kernel? I guess.
ladnar:
I was worried modprobe didn't know the path pr couldn't work from root , from /
This website https://gist.github.com/gbaman/4c1345c0c4d6d82149d4 , although for Raspbian, says this
--- Quote ---11. To manually load a kernel module, after rebooting use sudo modprobe moduleName. To unload a module, use sudo rmmod moduleName.
--- End quote ---
That seemed like good advice. Also, the previous 6 items.
6.Then run sudo cp -R /tmp/PiZeroCombined/fat32/* /boot/ (to copy the kernel and device tree stuff)
7. Then run sudo cp -R /tmp/PiZeroCombined/ext4/lib/* /lib/ (to copy the kernel modules themselves)
8. At this point, you have 2 options, you can either set the module you want to run on startup, or dynamically load and unload them.
9. To set a module to load on startup, edit the modules file with sudo nano /etc/modules and add the module name you want to start (e.g. g_ether) to the end on a new line. Also, make sure to the check the "Using the modules" section before rebooting.
10.Then, reboot the Raspberry Pi using sudo reboot.
I assume things are similar for PiCore. "6.Configure kernel? , 7. Load the necessary modules? 8-9. Add sudo modprobe g_ether to onboot.lst ? 10. then, make persistent (filetool.lst ; and "backup") and reboot.
and, of course, 11. modify config.txt with the dtoverlay=dwc2 line.
No warranty on the above methodology. In fact, is there an opposite of a warranty? Indemnification? Warning.
ladnar:
OK, I su-did the following (You like that one? I made that one up myself!)
modprobe g_ether.ko
modprobe udc-core.ko
modprobe libcomposite.ko
modprobe usb_f_rndis.ko
modprobe u_ether.ko
I think That's everything. I should make it persistent.
I forgot to check if I have the 1900+ files of the entire 4.9.22 zipped modules file (I've got them backed up, stored, on my kali laptop; but they won't do much good there! Have to get them persistent and in the right folders on the piCore-slave uSD, and get the kernel to talk to them? config-ed with them? or whatever it is that modules do with kernels?).
I have a notebook around here with simple CLI commands like "How many freakin' MB of data in this folder", and "How many files in this folder; and all the folders beneath it?".
"How many files does this folder collect, before you can call it a man? How many Trees, of devices are here, stored within this silicon we got from sand? Yes and how many times, must the Shebangs fly, before we close it out with a Sh@z@m? The answer my friend, is not in this crappy poem; the answer is not in my bad poems."
ladnar:
Sorry if this brings you back to Linux preschool, but the repetition helps me.
Count Files using wc :
$ ls | wc -l
Count Files Recursively using find :
$ find <directory> -type f | wc -l
Count Files using tree :
$ tree <directory>
3 directories, 3 files
Check Disk Usage in Linux Using the du Command :
du <options> <location of directory or file>
I DON'T have all 1900+ files persistent on the card. i goofed up somewhere? But maybe don't need them? I modprobed the five .ko's that I KNOW I need.
I bet I have to "configure the kernel" (whatever that means?) ... Yuuuuclk .... uggggh! Onerous tasks!
I guess for tonight, I will depmod -a to update the module.dep file (or not; maybe try it with and without update?); and I will alter config.txt to say dtoverlay=dwc2 ; and I will look for an etc/modules (like in raspbian) to add g_ether as the last line; but picore probably wants it in the onboot.lst, I'll wager? Then try to boot piCore as a g_ether gadget device.
If that doesn't work, I will have to quit for a few days while I read about kernel configuration.Yuck. I mean, closed door=opened window ?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version