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
Then plug the usbstick and upload openwrt-adm5120-br-6104kp-squashfs-xmodem.bin to the board via xmodem (use the attached script). When upload is done, watch the board booting with minicom.
Hope this helps, I'm available for troubleshooting on this.
Attachments:
xmodem-upload:
########################################
#!/usr/bin/expect -f
set dev "/dev/ttyUSB0"
set file "openwrt-adm5120-br-6104kp-squashfs-xmodem.bin"
system "stty 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke < $dev"
spawn -open [ open $dev r+ ]
send_user "* Waiting for the prompt, please turn on the router\n"
expect "ADM5120 Boot:"
send_user "\n* Got prompt, waiting for the second prompt\n"
send " "
expect "Please enter your key : "
send_user "\n* Got second prompt, uploading firmware $dev\n"
send "a"
close
system "sx -vv $file > $dev < $dev"
spawn -open [ open $dev r+ ]
expect "Please enter your key : "
send_user "\n* Got second prompt, booting\n"
send "c"
########################################
(Last edited by heruan on 30 Jan 2009, 02:58)