Now use gunzip to uncompress miniroot.gz and then mount it (mount -o loop miniroot /mnt). Open linuxrc with your editor. You need to load the relevant usb-modules and make sure to sleep some time, because the modules need some time to recognize your USB Memory stick. I put the relevant parts before the scsi modules are loaded to make sure, that my USB Memory Stick will be /dev/sda:
# load usb-modules first (so that memory-stick becomes /dev/sda1) # uncomment for USB 2.0 support (experimental) #insmod -f /modules/usb/ehci-hcd.o insmod -f /modules/usb/usbcore.o insmod -f /modules/usb/usb-uhci.o insmod -f /modules/usb/uhci.o insmod -f /modules/usb/usb-ohci.o insmod -f /modules/usb/usb-storage.o # need to sleep because it takes some time to register things ash -c "sleep 4"
Now you need to make sure, that your root-fs is mounted to /cdrom: I commented out the section in linuxrc where a CDROM is searched and put the following lines in:
# mount /dev/sda1 (memorystick to cdrom) FOUND_KNOPPIX="/dev/sda1" mount -t vfat /dev/sda1 /cdromYou can get my modified linuxrc here
Now we still need the usb modules (that aren't on the miniroot). Mount the compressed KNOPPIX file (insmod cloop file=PATH/KNOPPIX && mount -t iso9660 /dev/cloop /cdrom) and copy the following files under /cdrom/lib/modules/$KERNELVERSION/kernel/drivers/usb/ to /mnt/modules/usb/:
ehci-hcd.o uhci.o usb-ohci.o usb-storage.o usb-uhci.o usbcore.o
Now you're finished modifying miniroot. Umount it and gzip the file again.
sh-2.05b# ls -lR .: total 1576 -rw-r--r-- 1 root root 54 Apr 27 12:48 autorun.bat -rw-r--r-- 1 root root 47 Apr 27 12:48 autorun.inf -rw-r--r-- 1 root root 180 Apr 27 12:48 boot.msg -rw-r--r-- 1 root root 1759 Apr 27 12:48 f2 -rw-r--r-- 1 root root 256 Apr 27 12:48 german.kbd dr-xr--r-- 2 root root 4096 Apr 27 12:48 knoppix -rw-r--r-- 1 root root 3262 Apr 27 12:48 knoppix.ico -r--r--r-- 1 root root 7836 Apr 27 12:51 ldlinux.sys -rw-r--r-- 1 root root 34395 Apr 27 12:48 logo.16 -rw-r--r-- 1 root root 607866 Apr 27 14:03 miniroot.gz -rw-r--r-- 1 root root 2402 Apr 27 12:48 syslinux.cfg -rw-r--r-- 1 root root 921602 Apr 27 12:48 vmlinuz ./knoppix: total 50820 -rw-r--r-- 1 root root 2048 Apr 27 12:48 boot.cat -rw-r--r-- 1 root root 1474560 Apr 27 12:48 boot.img -rw-r--r-- 1 root root 50553629 Apr 27 04:48 knoppix -rw-r--r-- 1 root root 27 Apr 27 12:48 mkfloppy.batNow you need to get the Memory Stick bootable: umount it and run 'syslinux /dev/sda1' (or /dev/sd?1 depending on your system).
You can get my modified Damn Small Linux here (52 MB)
Comments to: Matthias Müller