Posted: Tue Dec 23, 2008 14:24 Post subject: Boot router from usb flash drive
Hi! I am sorry for my bad English
I have router Asus WL-520GC with 2Mb flash memory and would like to use DD-WRT MEGA firmware.
In the Russian forum there is a decision, allowing to load any MEGA firmware from usb flash drive on D-Link DIR-320 (4mb flash).http://dd-wrt.com/phpBB2/viewtopic.php?t=43389
In this case for the start of router and mounting partition on usb flash drive, std-nokaid_usb.bin is used.
For the use of this method on 2mb devices with USB onboard (like ASUS WL-520GC, possibly also devices with SD/MMC support and low flash size),it is necessary to build 2Mb firmware with usb and jffs support (cleaning all superfluous, including web-interface).
Can you help me? _________________ DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
I'm rebuild dd-wrt-micro-plus-ssh and delete ssh, pppoe. It allowed to free almost 500кб of free space, and I added drivers for usb.
This is result of dmesg command on my WL-520GC after firmware mod:
Code:
root@asus_wrt:~# dmesg
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:471a
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
root@asus_wrt:~#
Now, my router waits for hardware mod _________________ DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
root@asus_wrt:~# dmesg
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:471a
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device 00:03.0-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: Generic Model: USB SD Reader Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 31360 512-byte hdwr sectors (16 MB)
sda: Write Protect is off
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
_________________ DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
Congrats! Is there a way you can give us, a step by step process of what you did. Including the Hardware mod that you did. _________________
Routers:
E2000 latest BIG
whr-g54s client vpn
wr850g lastest mini
Joined: 18 Jun 2006 Posts: 1110 Location: Kiel (54.4247,10.1721)
Posted: Thu Dec 25, 2008 2:33 Post subject:
at least the command to bootup the .bin that is on the usb-stick / sd-card would be a nice-to-know...
so running mega on the wrt54g series would be really cool since adding a sd-card is so easy there _________________ DD-WRT F.A.Q. Webcam Kiel
I always hoped that once USB support on routers became more common that dd-wrt could evolve into something like the slug (nearly all of its alternative firmwares utilize USB storage).
Today I do an improvement and simplification of hardware mod and in the evening will do a step by step process. _________________ DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
Sorry for my bad English, my russian discussion is here
Hardware mod.
1. You must use 5V 2A power adapter for router.
2. On board : NF1 – data+ & data-, resistors 20 – 50 Ohm.
3. F1 – resistor 0,2-0,5 Ohm (you can use 0 Ohm), BF12 – resistor 0 Ohm.C9 (C130) - SMD 0,1mF or any other 0,1mF between +VCC USB and GND.
4. R56, R3 – 0 Ohm.
5. USB connector (J3):
*GND
*data+
*data-
*+5V
1. Unpack micro-plus-ssh with FirmwareModKit
2. Go to /rootfs/usr/sbin and remove 2 files: dropbearmulti и pppd.
3. Copy into /rootfs/lib/modules/<kernel>/ drivers: usbcore.o, usb-ohci.o, scsi_mod.o, usb-storage.o, sd_mod.o,ext2.o. (from unpacked nokaid, mega).
4. Go to rootfs/sbin
5. Move file init into rootfs/usr/sbin
6. Create new file rootfs/sbin/init:
Code:
#!/bin/sh
if [ $1 == "noinitrd" ] ; then
insmod /lib/modules/`uname -r`/usbcore.o
insmod /lib/modules/`uname -r`/usb-ohci.o
insmod /lib/modules/`uname -r`/scsi_mod.o
insmod /lib/modules/`uname -r`/usb-storage.o
insmod /lib/modules/`uname -r`/sd_mod.o
insmod /lib/modules/`uname -r`/ext2.o
sleep 8s
mount -t proc none /proc
mount -t ext2 -o noatime,nodiratime /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
if [ -x /mnt/sbin/init ] ; then
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
exec /sbin/init $*
}
else
exec /usr/sbin/init $*
fi
else
exec /usr/sbin/init $*
fi
Make this file executable.
7. Build firmware image and put it into router.
8. Create ext2 linux partition on usb flash drive (partition must be first in partition table, and size >= 15Mb)
9. Unpack MEGA firmware and put contents of rootfs to partition on usb flash drive. Change all files owner to 'root'.
Now, you can boot router from usb flash drive avtomaticaly if usb flash drive with ext2 partition is plugged.