All pastes #2010094 Raw Edit

pivotroot

public text v1 · immutable
#2010094 ·published 2010-12-04 00:08 UTC
rendered paste body
#!/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 ext2 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/jffs /jffs 2>&-
                mount -o move /mnt/sys /sys 2>&-
        }
}