P. 1
[Howto] Install Optware on Atheros Units (Such as WNDR3700)

[Howto] Install Optware on Atheros Units (Such as WNDR3700)

|Views: 612|Likes:
Published by nbsp

More info:

Published by: nbsp on Jun 15, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





All thanks are going to this guy: http://g300nh.blogspot.

com/2010/06/software-installation-on-dd-wrt-part-1.html http://g300nh.blogspot.com/2010/06/software-installation-on-dd-wrt-part-2.html

1. Prepare the USB disk
Create an ext3 partition using GParted for instance

2. Configure DD-WRT
Under Services->Services->Secure Shell: * Enable SSHd * Click Apply Settings Under Services->USB: * Enable Core USB Support * Disable USB Printer Support (enable it if you need printing support) * Enable USB Storage Support * Enable Automatic Drive Mount * Set Disk Mount Point to /mnt * Click Apply Settings

3. Plug the USB drive into the router and reboot it
* SSH into your box using user root and make sure, using mount, that your USB stick was mounted correctly (you can also check this on the web interface under Services->USB).

4. Create and prepare necessary structure
* SSH into your box using user root if not already done at previous step: cd /mnt/sda_part1 mkdir etc opt root touch optware.enable chmod 755 etc opt root mkdir opt/lib chmod 755 opt/lib cp -a /etc/* /mnt/sda_part1/etc/ mount -o bind /mnt/sda_part1/etc /etc mount -o bind /mnt/sda_part1/opt /jffs

5. Install the required libraries for the MIPS (big-endian) architecture and OpenWRT's opkg
cd /tmp wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/libc_0.9.33-107_ar71xx.ipk wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/opkg_618-2_ar71xx.ipk ipkg install libc_0.9.33-107_ar71xx.ipk opkg_618-2_ar71xx.ipk You will get the following output with error messages. You can't avoid it so don't worry about it. ERROR: File not found: //usr/local/lib/ipkg/lists/whiterussian You probably want to run `ipkg update' ERROR: File not found: //usr/local/lib/ipkg/lists/non-free You probably want to run `ipkg update' ERROR: File not found: //usr/local/lib/ipkg/lists/backports You probably want to run `ipkg update' /bin/ipkg: line 1184: sort: not found Unpacking libc...Done. Configuring libc...Done. ERROR: File not found: //usr/local/lib/ipkg/lists/whiterussian You probably want to run `ipkg update' ERROR: File not found: //usr/local/lib/ipkg/lists/non-free You probably want to run `ipkg update' ERROR: File not found: //usr/local/lib/ipkg/lists/backports You probably want to run `ipkg update'

/bin/ipkg: line 1184: sort: not found Unpacking opkg...Done. Configuring opkg...Done. Type the following lines to create the configuration file for opkg: cat > /etc/opkg.conf << EOF src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages dest root /opt dest ram /opt/tmp lists_dir ext /opt/tmp/var/opkg-lists EOF Let's make sure everything works properly: umount /jffs mount -o bind /mnt/sda_part1/root /tmp/root mount -o bind /mnt/sda_part1/opt /opt export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib' opkg update You should see: Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz. Inflating http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz. Updated list of available packages in /opt/tmp/var/opkg-lists/snapshots.

6. Set the startup script to make the changes take effect each time upon reboot
Under DD-WRT’s web interface, Administration->Commands, input the following commands in the window then click "Save Startup": #!/bin/sh sleep 5 if [ -f /mnt/sda_part1/optware.enable ]; then mount -o bind /mnt/sda_part1/etc /etc mount -o bind /mnt/sda_part1/root /tmp/root mount -o bind /mnt/sda_part1/opt /opt else exit fi if [ -d /opt/usr ]; then export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib' export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin' else exit fi Note that some users have reported issues that they were able to fix by making the script sleep 10 seconds instead of 5.

7. Modification of the profile file
SSH into your box then copy/paste the commands below to PuTTY window to create a script running each time when user root logins: cat > /mnt/sda_part1/root/.profile << EOF export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib:/opt/usr/local/lib'

export PATH='/sbin:/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/usr/bin:/usr/sbin:/opt/usr/local/bin' export PS1='\[\033[01;31m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]' export TERMINFO='/opt/usr/share/terminfo' EOF The above script will set the variables for us and also provide a nice colored command line prompt.

8. Reboot and check
Reboot your device with reboot When it's back on the track, SSH into your box. Run opkg update You can start installing all kind of wild things ! Yeeehhhaaa ! Last edited by dynek on Wed May 16, 2012 7:31 pm; edited 20 times in total

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->