[Howto] Install Optware on Atheros units (such as WNDR3700)

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3 ... 27, 28, 29, 30, 31  Next
Author Message
oloth
DD-WRT Novice


Joined: 08 Dec 2010
Posts: 24

PostPosted: Sat May 24, 2014 10:57    Post subject: Reply with quote
corrinewinslow method with routvol remark (links) is confirmed to work with Buffalo WZR-HP-G300NH on 23720 build.

Here is the whole thing that worked for me:


corrinewinslow: I did this on a Buffalo WZR-HP-AG300H running build 23919

1. Prepare the USB disk

Create an ext3 partition using GParted for instance [I did ext2 (oloth)]



2. Configure DD-WRT

Under Services->Services->Secure Shell:
* Enable SSHd
* Click Apply Settings
[I had to reboot before SSHd was actually enabled]

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 [it doesn't let you chose mount point now, unless manual by UUID]
* 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:


Code:
cd /mnt/sda1
mkdir etc opt root
touch optware.enable
chmod 755 etc opt root
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /mnt/sda1/etc/
mount -o bind /mnt/sda1/etc /etc
mount -o bind /mnt/sda1/opt /jffs

5. Install the required libraries for the MIPS (big-endian) architecture and OpenWRT's opkg
Code:
cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/libc_0.9.33.2-1_ar71xx.ipk
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7_ar71xx.ipk
ipkg install libc_0.9.33.2-1_ar71xx.ipk opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-6_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'
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'
Unpacking opkg...Done.
Configuring opkg...Done.

Type the following lines to create the configuration file for opkg:


Code:
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:


Code:
mount -o bind /mnt/sda1/root /tmp/root
mount -o bind /mnt/sda1/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.
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":


Code:
#!/bin/sh

sleep 7

if [ -f /tmp/mnt/sda1/optware.enable ]; then
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/root /tmp/root
mount -o bind /tmp/mnt/sda1/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.

* By some reason new builds mount everything initially to /tmp/mnt/*



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:


Code:
cat > /mnt/sda1/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
Code:
opkg update
Sponsor
rkaede
DD-WRT User


Joined: 06 Aug 2009
Posts: 99

PostPosted: Wed May 28, 2014 10:19    Post subject: Reply with quote
can anyone confirm if myPage works for atheros kernel 3.0 now ??? thanks

also i need some guidance on this step
Set Disk Mount Point to /mnt [it doesn't let you chose mount point now, unless manual by UUID]

the only available option on my release 23720 is
mount point /jffs and /opt
Meanybucket
DD-WRT User


Joined: 12 May 2011
Posts: 52

PostPosted: Fri May 30, 2014 15:31    Post subject: Reply with quote
I just selected Automount and left the /jffs and /opt blank. Also the command: ipkg install libc_0.9.33.2-1_ar71xx.ipk opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-6_ar71xx.ipk , I had to change the -6 to -7.
_________________
Netgear R7000 | DD-WRT v3.0-r31520M kongac (03/01/17)
Geoff42
DD-WRT Novice


Joined: 24 Apr 2014
Posts: 9

PostPosted: Fri May 30, 2014 15:59    Post subject: Reply with quote
rkaede wrote:
can anyone confirm if myPage works for atheros kernel 3.0 now ??? thanks

It works for me Wink
I had to make sure that each mypage script starts with
Code:
#!/bin/sh

Also, several of the directories are looked for as sub-directories of "user", so to get around this I put in a symbolic link back to the same directory
Code:
cd /opt/www
ln -s . user


I mainly followed the MyPage wiki

http://www.dd-wrt.com/wiki/index.php/MyPage

and the very long thread in the forum

http://www.dd-wrt.com/phpBB2/viewtopic.php?p=385006#385006

I have hacked MyPage2.sh to replace the Broadcom WiFi commands with ones that work with Atheros.

Actually I have hacked the scripts to pull out the header and trailer stuff into separate files, leaving only the informational body in the separate MyPageN.sh scripts, to make it easier for me to see what is going on.

Quote:
also i need some guidance on this step
Set Disk Mount Point to /mnt [it doesn't let you chose mount point now, unless manual by UUID]

the only available option on my release 23720 is
mount point /jffs and /opt


I have a 2GB USB memory stick partitioned into 2 equal-ish ext2 partitions. I have then set up them up to be mounted as /jffs and /opt using the UUIDs displayed in the Services>USB page. I just use /jffs as some space and it is ext2 and not really formatted as a journaled flash file system.

Geoff
joni1101
DD-WRT Novice


Joined: 30 May 2014
Posts: 2

PostPosted: Fri May 30, 2014 21:03    Post subject: Reply with quote
Working on Buffalo WZR-600DHP running DD-WRT build 24160 (v24-sp2 2014-05-27 build)... some confusion arises from the GUI options and the terminal options overlaping. And since DDWRT evolves, automount has arisen and it has its own way of determining where it will mount the drives.

Geoff42 wrote:
rkaede wrote:
can anyone confirm if myPage works for atheros kernel 3.0 now ??? thanks

It works for me Wink
I had to make sure that each mypage script starts with
Code:
#!/bin/sh

Also, several of the directories are looked for as sub-directories of "user", so to get around this I put in a symbolic link back to the same directory
Code:
cd /opt/www
ln -s . user


I mainly followed the MyPage wiki

http://www.dd-wrt.com/wiki/index.php/MyPage

and the very long thread in the forum

http://www.dd-wrt.com/phpBB2/viewtopic.php?p=385006#385006

I have hacked MyPage2.sh to replace the Broadcom WiFi commands with ones that work with Atheros.

Actually I have hacked the scripts to pull out the header and trailer stuff into separate files, leaving only the informational body in the separate MyPageN.sh scripts, to make it easier for me to see what is going on.

Quote:
also i need some guidance on this step
Set Disk Mount Point to /mnt [it doesn't let you chose mount point now, unless manual by UUID]

the only available option on my release 23720 is
mount point /jffs and /opt


I have a 2GB USB memory stick partitioned into 2 equal-ish ext2 partitions. I have then set up them up to be mounted as /jffs and /opt using the UUIDs displayed in the Services>USB page. I just use /jffs as some space and it is ext2 and not really formatted as a journaled flash file system.

Geoff
Geoff42
DD-WRT Novice


Joined: 24 Apr 2014
Posts: 9

PostPosted: Sat May 31, 2014 10:05    Post subject: Reply with quote
The other thing, which I forgot when setting up MyPages, is that you need to point /tmp/ww at /opt/www. Since /tmp is cleared on a reboot, it needs to be restored, so I have put it in my onMount.sh script, using the commands :-
Code:
rmdir /tmp/www
ln -s /opt/www /tmp/www


Geoff
rkaede
DD-WRT User


Joined: 06 Aug 2009
Posts: 99

PostPosted: Sat May 31, 2014 11:21    Post subject: Reply with quote
finally manage to make it run. basically just edit all the guide from /mnt into /tmp/mnt.

i noticed firmware 23720 is full of feature. even bittorent (transmission) is included.

_________________
WZRHPG300NH - DDWRT v26854

ASUS AC68U merlin fw
Linksys EA6700 - factory firmware - sold
DD-WRT v3.0 --- 27506
r25408
gyurman
DD-WRT Novice


Joined: 16 Sep 2013
Posts: 5

PostPosted: Tue Jun 03, 2014 19:41    Post subject: Reply with quote
Geoff42 wrote:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=898166#898166

Thanks
DaAndi
DD-WRT Novice


Joined: 25 Aug 2013
Posts: 5

PostPosted: Sun Jun 29, 2014 12:27    Post subject: ipkg seems to be broken Reply with quote
with
DD-WRT v24-sp2 (06/23/14) std
(SVN revision 24461)
any step involving ipkg seems to fail
ipkg list
ipkg update
ipkg install

do nothing

recommendation how to fix this?
adbs98
DD-WRT Novice


Joined: 29 Jun 2014
Posts: 1

PostPosted: Sun Jun 29, 2014 20:59    Post subject: Reply with quote
I have the same issue. Well first I tried the stable supported version and ssh was broke. I validated this by reloading the beta version and it worked. But now I am fubard because ipkg doesn't work.

Get the following when trying to install the opkg package

ipkg install opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7_a
r71xx.ipk
ipkg_install_file: ERROR: File not found
root@DD-WRT:/tmp#

File is there and valid

Any help would be appreciated. Might need to bite the bullet and go back down and see if ssh will start working again.
g_abry
DD-WRT Novice


Joined: 01 Mar 2013
Posts: 2

PostPosted: Wed Jul 09, 2014 23:21    Post subject: Reply with quote
Hi, try ipkg -d /tmp/ install name.ipk

I got a problem after doing this guide:
opkg update gives -sh: opkg: not found
ipkg update gives nothing
I'm using dd-wrt v24-sp2 on a wr842ndv1
nickname13
DD-WRT Novice


Joined: 11 Jul 2014
Posts: 3

PostPosted: Fri Jul 11, 2014 8:04    Post subject: Reply with quote
I had the same problem

ipkg_install_file: ERROR: File not found


As it seems now ipkg needs the "destination" folder of the package you are going to install.
I think that

"ipkg -d /tmp/ install name.ipk"
is definitely NOT the answer because tmp is the ram so everything will be removed after reboot.
I tried

"ipkg -d root install name.ipk"

which is the same as using /jffs.

jffs is the folder we have bind with the "opt" folder we created in our external disk from the guide.(this is actually the place it should be installed)

but even though the installation seems to be running I still i get

opkg: not found

and the problem is not that it cannot find it because i tried to run it with it's full path
"/mnt/sda1/../opt/bin/opkg" and still i got the same message.

Sooo i got tired of trying and i downgraded. Too bad because beside that it's actually a very good release (solved me some minor problems that i had)
g_abry
DD-WRT Novice


Joined: 01 Mar 2013
Posts: 2

PostPosted: Sat Jul 12, 2014 14:14    Post subject: Reply with quote
What version did you chose to downgrade?
EDIT:
"ipkg -d root install name.ipk" works for me.
Thanks for help!
Only one more thing, when I reboot I must use
#mount -o bind /mnt/etc /etc
#mount -o bind /mnt/root /tmp/root
#mount -o bind /mnt/opt /opt
#opkg update
to start it... maybe the startup script doesn't work properly?
nickname13
DD-WRT Novice


Joined: 11 Jul 2014
Posts: 3

PostPosted: Mon Jul 14, 2014 6:56    Post subject: Reply with quote
cool g_abry happy I helped Smile

Now I am using revision 23919.

opkg update works for you now?
I was still getting
opkg: not found
Confused

My start up script had the bind lines but not the opkg update....but I don't think that has anything to do with my problem has it?
rocket
DD-WRT User


Joined: 28 Feb 2008
Posts: 111

PostPosted: Wed Jul 16, 2014 8:06    Post subject: Reply with quote
nickname13 wrote:

Now I am using revision 23919.

opkg update works for you now?
I was still getting
opkg: not found
Confused

I found the problem!! Smile

In versions 24461 and up the firmware don't includes the required /lib/ld-uClibc.so.0 that is hardcoded in the "opkg" tool from optware (check it with this command: "cat opkg | grep libc"). Moreovere all packages from the current optware repository are compiled with this hardcoded libpath.
Shocked Shocked Shocked

If you like to do some trick to fix it, you need to copy the file "/opt/lib/ld-uClibc.so" to "/opt/ld-uClibc.so" and replace in the binary the path (from /lib/ to /opt/). You can use this command:

Code:
$ sed -i "s|/lib/ld-uClibc.so.0|/opt/ld-uClibc.so.0|" opkg


However, this only fixes the opkg binary. Any other optware package will have the same problem (if you really need it, you can patch all binaries in /opt/).

Permanent solutions:

1) Suggest to BS to reincorporate this library in the firmware.

2) Suggest to maintainers of optware to change Makefiles and remove fixed libpath for uClibc.

I feel that option 1 is more simple. Please, BrianSlayer, can you restore the ld-uClibc library?

Best!
Goto page Previous  1, 2, 3 ... 27, 28, 29, 30, 31  Next Display posts from previous:    Page 28 of 31
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum