Who was looking for boot from USB?

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
regiscruzbr
Posts: 16
Joined: Fri Jul 24, 2009 10:54 pm

Who was looking for boot from USB?

Post by regiscruzbr »

I was looking for detailed instructions about how install mpd 1.5.2 on my router when I found this.

https://forum.openwrt.org/viewtopic.php?id=21377

I didn't try, but looks simple, especially the suggestion from Mr. Mavy.

Who want try? ;)
pxshock
Posts: 6
Joined: Fri Feb 05, 2010 7:22 pm

Re: Who was looking for boot from USB?

Post by pxshock »

Has any one got this to work? I just spent the last 10 hrs trying, and i dont know what i am doing wrong.

i tried a number of resources, but no go on booting from usb flash disk . :-(
https://forum.openwrt.org/viewtopic.php?id=21377
https://forum.openwrt.org/viewtopic.php?id=11495
https://forum.openwrt.org/viewtopic.php?id=17642
http://wiki.openwrt.org/oldwiki/usbstoragehowto
http://wiki.openwrt.org/oldwiki/openwrt ... diahowto?s
http://wiki.openwrt.org/oldwiki/nielsbo ... .partition

lots of reading, lots of copy and pasting, loaaads of rebooting.

Please let us know if any one has gotten this to work

Since were more discussing about the wl-520gU. it might be beneficial to the wifi project.

Thanks
eli2k
Posts: 22
Joined: Mon Jul 27, 2009 12:38 am

Re: Who was looking for boot from USB?

Post by eli2k »

nifty! this means you can run unlimited things on the router this way?
ilinux
Posts: 55
Joined: Mon Jul 06, 2009 2:36 am

Re: Who was looking for boot from USB?

Post by ilinux »

.your problem is that your router can't support glib because is too huge.


You can install 0.13.x version or maybe you can install mpd on usb..

In my opinion if you don't need last.fm I suggest to use 0.13 version because the last from trunk don't allow to play mms stream and aac :roll:

If you can wait some days I suggest to install wrtradio 0.2 (not wrtradio 0.1 because is over your flash size) with comes with all needs .

Let me know :D
pxshock
Posts: 6
Joined: Fri Feb 05, 2010 7:22 pm

Re: Who was looking for boot from USB?

Post by pxshock »

ilinux wrote:.your problem is that your router can't support glib because is too huge.


You can install 0.13.x version or maybe you can install mpd on usb..

In my opinion if you don't need last.fm I suggest to use 0.13 version because the last from trunk don't allow to play mms stream and aac :roll:

If you can wait some days I suggest to install wrtradio 0.2 (not wrtradio 0.1 because is over your flash size) with comes with all needs .

Let me know :D
I would like to make my router an all purpose device, and i am running out of space to install apps, wifi radio among other things, that is why i wanted to boot from usb.

I took the day off today, you know to clear my head, ill be at it tomorrow. Ill certainly post my results. And, again, if any one has had any success with booting from usb, please let us know.

Thanks
pxshock
Posts: 6
Joined: Fri Feb 05, 2010 7:22 pm

Re: Who was looking for boot from USB?

Post by pxshock »

got it to work finally!!!

http://wiki.openwrt.org/oldwiki/usbstoragehowto
Try to read, and understand, and follow with precision.

this is another good link i used
http://www.yorkspace.com/2009/03/134

my issue was the modules, i wasnt calling the right ones...seems i was missing out the usb 2 module "insmod ehci-hcd" because my hub apparently needed it (i wasted sooo much time on this!)

The awesome thing is that, if you pluck out the usb, then it just boots from the routers flash. :-)

You can now boot from usb flash drive with OpenWRT on the asus WL-520gU

here is my pivotroot file
vi /etc/init.d/pivotroot

#!/bin/sh
# change this to your boot partition
boot_dev="/dev/scsi/host0/bus0/target0/lun0/part1"
# 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 usb-ohci scsi_mod sd_mod usb-storage jbd ext2 ext3 ; do {
insmod $module
}; done
# this may need to be higher if your disk is slow to initialize
sleep 12s
# 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/jffs2 /jffs2 2>&-
mount -o move /mnt/sys /sys 2>&-
}
}

here is my rcS file

vi /etc/init.d/rcS

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
if test $2 == "boot" ; then
/etc/init.d/pivotroot
fi
{
for i in /etc/rc.d/$1*; do
$i $2 2>&1
done
} | logger -s -p 6 -t '' &


vi /etc/modules.d/60-usb-storage

scsi_mod max_scsi_luns=8
sd_mod
usb-storage

_------------_____________------------------_______________-----------------__________----------------_________-----------------____-----

here is some proof :-)




BusyBox v1.11.2 (2009-12-02 06:19:32 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
KAMIKAZE (8.09.2, r18961) -------------------------
* 10 oz Vodka Shake well with ice and strain
* 10 oz Triple sec mixture into 10 shot glasses.
* 10 oz lime juice Salute!
---------------------------------------------------
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 949.6M 25.0M 876.4M 3% /
/dev/root 1.6M 1.6M 0 100% /mnt/rom
tmpfs 7.0M 48.0k 6.9M 1% /tmp
/dev/mtdblock/4 1.8M 1.1M 756.0k 59% /mnt/jffs
mini_fo:/jffs 1.6M 1.6M 0 100% /mnt
/dev/scsi/host0/bus0/target0/lun0/part1
949.6M 25.0M 876.4M 3% /
root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8 ... ackages.gz
Connecting to downloads.openwrt.org (78.24.191.177:80)
Packages.gz 100% |************************************************************************************************************| 130k 00:00:00 ETA
Inflating http://downloads.openwrt.org/kamikaze/8 ... ackages.gz
Updated list of available packages in /var/opkg-lists/snapshots
root@OpenWrt:~# opkg install nano
Installing nano (2.0.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
nano_2.0.7-1_mipsel. 100% |************************************************************************************************************| 32604 00:00:00 ETA
Installing libncurses (5.6-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libncurses_5.6-1_mip 100% |************************************************************************************************************| 139k 00:00:00 ETA
Configuring libncurses
Configuring nano
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 949.6M 25.5M 875.9M 3% /
/dev/root 1.6M 1.6M 0 100% /mnt/rom
tmpfs 7.0M 700.0k 6.3M 10% /tmp
/dev/mtdblock/4 1.8M 1.1M 756.0k 59% /mnt/jffs
mini_fo:/jffs 1.6M 1.6M 0 100% /mnt
/dev/scsi/host0/bus0/target0/lun0/part1
949.6M 25.5M 875.9M 3% /
root@OpenWrt:~# opkg install rtorrent
Installing rtorrent (0.8.2-1.1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
rtorrent_0.8.2-1.1_m 100% |************************************************************************************************************| 448k 00:00:00 ETA
Installing libcurl (7.17.1-1.2) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libcurl_7.17.1-1.2_m 100% |************************************************************************************************************| 96349 00:00:00 ETA
Installing libopenssl (0.9.8i-3.2) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libopenssl_0.9.8i-3. 100% |************************************************************************************************************| 472k 00:00:00 ETA
Installing zlib (1.2.3-5) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
zlib_1.2.3-5_mipsel. 100% |************************************************************************************************************| 35671 --:--:-- ETA
Installing libtorrent (0.12.4-1.1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libtorrent_0.12.4-1. 100% |************************************************************************************************************| 459k 00:00:00 ETA 459k 00:00:00 ETA
Installing libsigcxx (2.2.3-1.1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
wget: no response from server
Configuring libcurl
Configuring libopenssl
Configuring libtorrent
Configuring zlib
Collected errors:
* opkg_download: ERROR: Command failed with return value 1: `wget --passive-ftp -P /tmp/opkg-YruoGL http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk'
* Failed to download libsigcxx. Perhaps you need to run 'opkg update'?
root@OpenWrt:~# opkg install rtorrent
Installing rtorrent (0.8.2-1.1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
rtorrent_0.8.2-1.1_m 100% |************************************************************************************************************| 448k 00:00:00 ETA
Installing libsigcxx (2.2.3-1.1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libsigcxx_2.2.3-1.1_ 100% |************************************************************************************************************| 10235 --:--:-- ETA
Installing libstdcpp (3.4.6-14.3) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
libstdcpp_3.4.6-14.3 100% |************************************************************************************************************| 148k 00:00:00 ETA
Configuring libsigcxx
Configuring libstdcpp
Configuring rtorrent
root@OpenWrt:~# opkg install screen
Installing screen (4.0.3-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8 ... mipsel.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
screen_4.0.3-1_mipse 100% |************************************************************************************************************| 158k 00:00:00 ETA
Configuring screen
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 949.6M 31.6M 869.7M 4% /
/dev/root 1.6M 1.6M 0 100% /mnt/rom
tmpfs 7.0M 700.0k 6.3M 10% /tmp
/dev/mtdblock/4 1.8M 1.1M 756.0k 59% /mnt/jffs
mini_fo:/jffs 1.6M 1.6M 0 100% /mnt
/dev/scsi/host0/bus0/target0/lun0/part1
949.6M 31.6M 869.7M 4% /
root@OpenWrt:~#
Last edited by pxshock on Wed Feb 10, 2010 11:24 pm, edited 2 times in total.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Who was looking for boot from USB?

Post by mightyohm »

pxshock,

Very nice work! This should be very helpful for others trying to get more out of their 520gU than the builtin flash allows.

Now I have another thing I need to play with when I pick up my next router. :D

Thanks for posting!
jeroen94704
Posts: 109
Joined: Sat Feb 13, 2010 4:27 am
Location: Eindhoven, the Netherlands

Re: Who was looking for boot from USB?

Post by jeroen94704 »

Just to add a bit to this: I tried getting my WL-500G to boot from USB as well, but it's just too complicated for my taste. So instead, I install the necessary USB-storage packages and install packages that don't fit on the router's own flash memory on a USB memory stick. The gotcha here is that you need to set the LD_LIBRARY_PATH environment variable, or applications won't be able to find the libraries you install on the USB target.
Post Reply