Portál AbcLinuxu, 10. května 2025 02:10
#!/bin/sh
# change this to your boot partition
boot_dev="/dev/scsi/host0/bus0/target0/lun0/part1"
# *** Replace the "/dev/scsi/host0/bus0/target0/lun0/part1" device with your own if differs ***
# 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 ehci-hcd scsi_mod sd_mod usb-storage ext2; do {
insmod $module
}; done
# this may need to be higher if your disk is slow to initialize
sleep 10s
# 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>&-
}
}
# finally, run the real init (from USB hopefully).
exec /bin/busybox init
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.