#!/bin/sh # change this to your boot partition boot_dev="/dev/scsi/host0/bus0/target0/lun0/part2" # install needed modules for usb and the ext3 filesystem # **NOTE** for usb2.0 replace "uhci" with "ehci-hcd" # **NOTE** for ohci chipsets replace "uhci" with "usb-ohci" for module in usbcore usb-ohci scsi_mod sd_mod usb-storage jbd ext3; do { insmod $module }; done # this may need to be higher if your disk is slow to initialize sleep 4s # mount the usb stick mount "$boot_dev" /mnt # if everything looks ok, do the pivot root [ -x /mnt/sbin/init ] && { mount -o move /proc /mnt/proc && \ pivot_root /mnt /mnt/mnt && { mount -o move /mnt/dev /dev mount -o move /mnt/tmp /tmp mount -o move /mnt/jffs2 /jffs2 2>&- mount -o move /mnt/sys /sys 2>&- } } # finally, run the real init (from USB hopefully). exec /bin/busybox init