heruan wrote:Finally I've found how to mount USB stick at boot without patching /etc/preinit or anything else.
These the step I've followed (revision 14152):
* make menuconfig
** Target System -> Infineon/ADMtek ADM5120 [2.6]
** Target Profile -> Edimax BR-6104KP (Unofficial)
** busybox -> Configuration -> Coreutil -> stty (don't know if necessary)
** removed some packages (to fit firmware size): dnsmasq, dropbear, iptables (will be installed later with opkg)
* make kernel_menuconfig
** Machine selection -> Infineon/ADMtek ADM5120 SoC based machines
** Device drivers -> Memory Technology Device (MTD) support:
*** disable Automatically set 'rootfs' partition to be root filesystem
*** disable Automatically split 'rootfs' partition for squashfs
*** disable Automatically find and split TRX partitions
** Device drivers -> SCSI device support:
*** {*} SCSI device support
*** <*> SCSI disk support
** Device drivers -> [*] USB support:
*** <*> Support for Host-side USB
*** [*] USB device filesystem
*** <*> USB Storage support
*** <*> ADM5120 HCD support (EXPERIMENTAL)
** File systems -> <*> Ext3 journalling filsystem support
** Kernel hacking -> Default kernel command string (last setting): console=ttyS0,115200 root=/dev/sda1 init=/etc/preinit ro rootdelay=10
Then run make and wait for OpenWRT to be built. Then under bin/ you'll find:
* openwrt-adm5120-br-6104kp-squashfs-webui.bin
* openwrt-adm5120-br-6104kp-squashfs-xmodem.bin
* openwrt-adm5120-rootfs.tgz
Format a USB-stick with ext3 fs (assuming /dev/sdb1) and untar the rootfs:
# mkfs.ext3 /dev/sdb1
# mount /dev/sdb1 /mnt
# cd /mnt
# tar -xzf /path/to/openwrt/bin/openwrt-adm5120-rootfs.tgz
So basically what you are doing is remove the kernel ability to see the MTD files and to find the USB devices and the first device is sda so it mounts that and moves forward. Cool I like that idea
Any one tried it with an asus in particular 500w
i used to modify preinit to look for a preinit.usb if it existed
and then do something like
# load the proper modules
# Does The drive Exist
echo "- is $MNTDEV there -"
if [ -e "$MNTDEV" ]
then
echo "- yes -"
# Can we mount it
if mount -o rw,noatime "$MNTDEV" /mnt
then
echo "- mounted -"
# Is there a usb.boot file and an executable /mnt/sbin/init file
if [ -e /mnt/.usb.boot ] && [ -x /mnt/sbin/init ]
then
echo "- Files exist about to pivot -"
mount -o move /proc /mnt/proc && \
pivot_root /mnt /mnt/rom && {
mount -o move /rom/sys /sys
mount -o move /rom/tmp /tmp
mount -o move /rom/dev /dev
mount -o move /rom/dev/pts /dev/pts
echo "- pivot successful -"
rc=0
}
else
echo "- files not there ! -"
# files doesn't exist umount drive
umount /mnt
fi
fi
fi
kill $H
echo "- return -"
set +x
return $rc
(Last edited by alexsamad on 18 Feb 2009, 10:23)