The 'init' script in Puppy is able to determine all non-USB drives, which are written to ATADRIVES variable in /etc/rc.d/PUPSTATE.
Then, the init script loads usb_storage module, then waits for USB scanning to settle -- this is where I ran into a problem with 2.6.33+ kernels.
I wrote about the 2.6.33+ problem here:
There are two problems that I want to solve. Firstly, a way to determine which drives are USB, when usb_storage module is already loaded. If I can do this, then usb_storage could be built into the kernel. A bit of reasearch and I found out how:
I find that the layout in /sys keeps changing, so dredging through it gets broken with different kernel versions. However, the "udevadm info -p /sys/block/sdb --query=env" looks good.
Wait until USB drives are available. I still don't know how to do this, without patching usb.c and inserting the "device scan complete" etc. printk's.
I was reading about one distro, can't recall where, they just put in a sleep. Not at all satisfactory.
Comments:Posted on 4 Jun 2011, 5:08 by Dougal
I just use:
case $(readlink /sys/block/$DEV) in */usb[0-9]/*) USBDRIVES="$USBDRIVES $DEV" ;; esac
Posted on 4 Jun 2011, 8:37 by BarryK
Yes, a simple solution.
Posted on 4 Jun 2011, 14:46 by Iguleder
Improved kernel build script
Barry - I'm working on an improved kernel build script. This time it's a Python script which generates the actual build script, to reduce the impact of the human factor even further.
It also comes with a patch that adds a Puppy logo in 224 colors, so people who use a capable framebuffer console should see it.
Another nice feature is support for Linux-libre: the script has a configuration file named "config.py" with a boolean named "LINUX_LIBRE". If you put "True" there, the build script generator will automatically generate a build script which downloads the right Linux-libre scripts and deblobs your kernel.
Here's an example, for 184.108.40.206 ... and this is the configuration file used. Looks pretty tidy!
Posted on 5 Jun 2011, 24:48 by linuxcbon
The init structure should be (if not mistaken) :
- mount filesystem
- make nodes
- local time
- mount system
Posted on 6 Jun 2011, 8:31 by linuxcbon
I read that the modprobes needed for usb are in this order : usbcore, ehci_hcd, ohci_hcd, usbhid, usb_storage. So no need of waiting ?