Boot router from usb flash drive

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3 ... 15, 16, 17  Next
Author Message
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Tue Dec 23, 2008 14:24    Post subject: Boot router from usb flash drive Reply with quote
Hi! I am sorry for my bad English Embarassed
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]
Sponsor
MrAlvin
DD-WRT User


Joined: 07 Jan 2007
Posts: 457
Location: Denmark

PostPosted: Tue Dec 23, 2008 16:54    Post subject: Reply with quote
Sounds like a very interesting idea, and it would certainly give dd-wrt an unprecedented flexibility.
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Wed Dec 24, 2008 0:26    Post subject: Reply with quote
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 Smile

_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Wed Dec 24, 2008 13:29    Post subject: Reply with quote
520GC unlike 520GU has power 9V DC, therefore for the use of USB it is necessary to stabilize it to 5V DC.

Also, usb-data lines must have resistors for a concordance.

520GU board:



gu-part.JPG
 Description:
 Filesize:  17.32 KB
 Viewed:  86537 Time(s)

gu-part.JPG



_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Wed Dec 24, 2008 20:57    Post subject: Reply with quote
Yes! It works fine!
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.
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]
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Wed Dec 24, 2008 21:44    Post subject: Reply with quote
Now my WL-520GC have USB port and running dd-wrt mega from usb flash drive.
Screenshots is here http://www.dd-wrt.com/phpBB2/viewtopic.php?p=243204#243204.

Thanks to all for help.

_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
HockeyFan4Life
DD-WRT User


Joined: 03 Jan 2008
Posts: 230

PostPosted: Wed Dec 24, 2008 22:31    Post subject: Reply with quote
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
CaScAdE
DD-WRT Guru


Joined: 18 Jun 2006
Posts: 1110
Location: Kiel (54.4247,10.1721)

PostPosted: Thu Dec 25, 2008 2:33    Post subject: Reply with quote
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 Smile

_________________
DD-WRT F.A.Q.

Webcam Kiel
nemesisdb
DD-WRT User


Joined: 10 Oct 2006
Posts: 197

PostPosted: Thu Dec 25, 2008 5:57    Post subject: Reply with quote
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).
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Thu Dec 25, 2008 6:08    Post subject: Reply with quote
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]
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Thu Dec 25, 2008 20:28    Post subject: Reply with quote
USB and DD-WRT MEGA on Asus WL-520GC.

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

Photo:
more

more

more

more
more


Firmware mod (Thanks to IronShaft)

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.

Here is MICRO-PLUS-USB firmware, based on http://www.dd-wrt.com/dd-wrtv2/downloads/others/eko/V24_TNG/svn11218/dd-wrt.v24-11218_NEWD_micro-plus_ssh.bin

rootfs MEGA

_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]


Last edited by lightix on Sat Dec 27, 2008 8:00; edited 2 times in total
MrAlvin
DD-WRT User


Joined: 07 Jan 2007
Posts: 457
Location: Denmark

PostPosted: Thu Dec 25, 2008 22:29    Post subject: Reply with quote
GREAT job lightix. This means that any router with USB can now be made able to use Mega version of dd-wrt, plus more!

What a great proof of concept. Cool
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Sat Dec 27, 2008 8:00    Post subject: Reply with quote
Added links to firmware and unpacked rootfs of MEGA.
_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
decsan
DD-WRT Novice


Joined: 26 Dec 2008
Posts: 14
Location: TURKEY

PostPosted: Sat Dec 27, 2008 18:22    Post subject: Reply with quote
great!..
After that, can you use it as standalone downloader..
lightix
DD-WRT User


Joined: 03 Dec 2008
Posts: 111

PostPosted: Sat Dec 27, 2008 18:57    Post subject: Reply with quote
Last "tuning"



_________________
DD-WRT v24 sp2 MEGA on ASUS wl-520gc [with USB]
Goto page 1, 2, 3 ... 15, 16, 17  Next Display posts from previous:    Page 1 of 17
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum