Posted: Sat Feb 27, 2016 11:57 Post subject: EA6500 v1 optware using repository from openwrt Chaos Calmer
Recently I flashed my EA6500 v1 with dd-wrt build r29114 and I have successfully installed optware based on repository from openwrt Chaos Calmer 15.05 brcm47xx mips74k and I would like to share my experience as follows:
Basic ideas are taken from this thread: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=177532 and many thanks to msantos2007 for the guide. The guide is based on repository from openwrt Barrier Breaker 14.07 rc3. I read the latest posts from the thread that the link to Barrier Breaker 14.07 rc3 is broken recently and only Chaos Calmer 15.05 is available for download. However, ipkg is getting less and less compatible with the later openwrt releases.
By spending many trial and error, I finally figure out that there are a few missing files that stop the installation of libc and opkg. They are:
The best way to get the above files is by extracting a Chaos Calmer 15.05 build for EA6500 v1. Unfortunately EA6500 v1 is not supported by openwrt. Since Asus RT-N66U use the same CPU as EA6500 v1, so I extracted the RT-N66U image and got the files I want. The RT-N66U Chaos Calmer image can be downloaded from openwrt https://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k
During the optware installation, I need to use putty and WinSCP.
I am using a 2G USB thumb drive and formated it to ext2.
Enable USB core and USB storage support for the router. The USB drive will be mounted to /tmp/mnt/sda1
Use putty and enter the following commands:
cd /tmp/mnt/sda1
touch optware.enable
mkdir etc opt root bin lib usr
chmod 755 etc opt root bin lib usr
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /tmp/mnt/sda1/etc/
cp -a /bin/* /tmp/mnt/sda1/bin/
cp -a /lib/* /tmp/mnt/sda1/lib/
cp -a /usr/* /tmp/mnt/sda1/usr/
cp -a /opt/* /tmp/mnt/sda1/opt/
mkdir usr/lib/opkg
chmod 755 usr/lib/opkg
mkdir usr/lib/opkg/info
chmod 755 usr/lib/opkg/info
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/bin /bin
mount -o bind /tmp/mnt/sda1/lib /lib
mount -o bind /tmp/mnt/sda1/usr /usr
mount -o bind /tmp/mnt/sda1/opt /jffs
Using WinSCP,
Delete the link function.sh on /tmp/mnt/sda1/lib
Upload functions.sh to /tmp/mnt/sda1/lib
[Edited on 3/4/16] Right click on functions.sh and select properties, change permission and enable X for owner
Upload libc.ipk.control; libc.ipk.list; opkg.ipk.control and opkg.ipk.list to /tmp/mnt/sda1/usr/lib/opkg/info
Upload libc.ipk and opkg.ipk to /tmp
Back to putty and enter the following commands:
cd /tmp
ipkg -d / install libc.ipk (wait for it to unpack and config)
ipkg -d / install opkg.ipk (wait for it to unpack and config)
Back to WinSCP,
Go to /tmp/mnt/sda1/usr/lib/opkg/info and rename the control and list files back to libc.control; libc.list; opkg.control and opkg.list
Go to /tmp/mnt/sda1/etc and edit the file opkg.conf so that it looks like the following:
Use the PC and login to the router's webGUI and save the following startup commands (Go to Administration, Commands):
#! /bin/sh
sleep 10
if [ -f /tmp/mnt/sda1/optware.enable ]; then
mount -o bind /tmp/mnt/sda1/bin /bin
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/lib /lib
mount -o bind /tmp/mnt/sda1/opt /opt
mount -o bind /tmp/mnt/sda1/usr /usr
mount -o bind /tmp/mnt/sda1/root /tmp/root
sleep 2
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
You can reboot the router and use putty and opkg to install other ipk that you want.
The above is only tried on my EA6500 v1 and I think similar approach can be used for other routers but you have to make sure you change the repository to the correct one for your router as well as extracting the missing files from the right openwrt Chaos Calmer build specific for your router.
[Edited on 3/4/16] If you decide to upgrade dd-wrt firmware in the future, make sure to delete the optware from the usb drive and redo the above as the usb drive will hold the files from the old firmware and the best way is to do a clean install of the optware again after dd-wrt upgrade.
Posted: Sun Oct 16, 2016 1:31 Post subject: extracting the firmware
thank you for this post, you summed up everything i already had assumed after hours of trial and error. its the first usable and up2date piece of information i could find to finally get the optware working.
you could use ur 2gb usb as swap too on D-WRT v3.0-r30731 if u label partitions correspondingly the automount will even automatically assign the correct mountpoints and permissions.
Try Ubuntu 14.04 as that is the one that works for me! The firmware mod kit stop working after I upgrade my Ubuntu to a later one. So I am still using Ubuntu 14.04 for that reason.
well noted, thanks for the quick reply. im downloading ubuntu-14.04.5-desktop-amd64.iso now and try on livesystem. i will update this post after i got my files
it seems to be working (almost). im already able to do opkg update BUT he is parsing opkg.conf twice and then skips.
reason: there are 2 opkg.confs one directly in /etc and one in /tmp/mnt/sda1/etc ?? or is this because of bind ??
im not sure if i should just delete opkg.conf in /tmp/mnt/sda1/etc because if he mirrors this wont he mirror everything?
Here is what i changed because i use automounting and native labeling on a internal sdcard inside the n66u:
mount -o bind /jffs/etc /etc
mount -o bind /jffs/bin /bin
mount -o bind /jffs/lib /lib
mount -o bind /jffs/usr /usr
mount -o bind /jffs/opt /opt
mount -o bind /jffs/root /tmp/root
of course i didn't unmount /jffs because all the configuration is there..
EDIT: i believe i found the mistake please buzz me if i am wrong:
because i didn't bind my opt to a different location BEFORE initial update he now created a "double configuration".
question is now: can i fix it without starting over completely? do you have a concrete idea?
and as already said dd-wrt automatically reads the labels and binds the volumes to /opt, /jffs and enables swap. it also mounts the Data partition to tmp/mnt/sdb4 automatically.
I think the problem is related to /opt as it is auto-mounted before you start the optware setup so you missed a couple of steps such as
cp -a /opt/* /tmp/mnt/sda1/opt/
and
mount -o bind /tmp/mnt/sda1/opt /jffs
It is really hard to try to repair it as I have no idea what you have done and how messy is your optware setup now. I would rather suggest that you re-partition your USB drive and remove the start up script and redo the setup again.
I have no idea why you choose to partition your USB drive into 4 partitions instead of just one. I really see no benefit of doing so. If you really would like to have separate swap partition and data partition. I would suggest that you create one partition for optware and jffs but name it other than opt, optware nor jffs. Use label like opt_HDD or other name you like. You can create separate partition for swap and data as before.
If you need to keep jffs on USB drive, you can create a directory /jffs on the USB drive and add the following to the startup script after the setup:
mount -o bind /tmp/mnt/sda1/jffs /jffs
Last edited by js1662 on Mon Oct 17, 2016 12:06; edited 1 time in total
If your router has an USB port, you can install optware to an USB drive which then allows you to install additional software to the router. The additional software comes in the form of .ipk packages and openwrt host a lot of those ipk packages.
As to your other questions, yes, you need to reinstall optware after you update the router's firmware as some of the files from the router's flash are copied to the USB drive.
Regarding to whether it will introduce any latency, I think it depends on the additional software that you run as it will use up CPU resources.
Saw this post while researching ddwrt and optware and if you scroll to the bottom of the page you will see a heading "Backing up "clean" Optware setup and making sure all your Optware hacks survive a firmware upgrade"
Posted: Mon Oct 17, 2016 23:11 Post subject: start from scratch
Wiped all partitions on the sd card and reformatted one big ext2 partition. then did the following but still getting double parse error. where is this coming from? ::
cd /tmp/mnt/sda1
touch optware.enable
mkdir etc opt root bin lib usr
chmod 755 etc opt root bin lib usr
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /tmp/mnt/sda1/etc/
cp -a /bin/* /tmp/mnt/sda1/bin/
cp -a /lib/* /tmp/mnt/sda1/lib/
cp -a /usr/* /tmp/mnt/sda1/usr/
cp -a /opt/* /tmp/mnt/sda1/opt/
mkdir usr/lib/opkg
chmod 755 usr/lib/opkg
mkdir usr/lib/opkg/info
chmod 755 usr/lib/opkg/info
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/bin /bin
mount -o bind /tmp/mnt/sda1/lib /lib
mount -o bind /tmp/mnt/sda1/usr /usr
mount -o bind /tmp/mnt/sda1/opt /jffs
cd /tmp/mnt/sda1/lib
rm functions.sh
cd /tmp/mnt/sda1/usr/lib/opkg/info
cd /jffs/trxfiles
cp functions.sh /tmp/mnt/sda1/lib
cp libc.ipk.control libc.ipk.list opkg.ipk.control opkg.ipk.list /tmp/mnt/sda1/usr/lib/opkg/info
cp libc.ipk opkg.ipk /tmp
ipkg -d / install libc.ipk (wait for it to unpack and config)
ipkg -d / install opkg.ipk (wait for it to unpack and config)
cd /tmp/mnt/sda1/usr/lib/opkg/info
mv libc.ipk.control libc.control
mv libc.ipk.list libc.list
mv opkg.ipk.control opkg.control
mv opkg.ipk.list opkg.list
cd /tmp/mnt/sda1/etc
I am not sure but it could be because you are using the more updated 15.05.1 and it is possible that openwrt has make some major changes. So if you don't mind and have the time, can you try using 15.05 instead and see if you can get a good result. Please make sure all the files are from 15.05 including functions.sh and others.
Posted: Sun Oct 23, 2016 20:30 Post subject: Optimized tutorial for lazy people :)
Please follow these steps PRECISElY or it will not work. Only change something if you know what you are doing.
Enable JFFS, USB core and USB storage support for the router. The USB drive will be mounted to /tmp/mnt/sda1
Connect to your device with via ssh, putty (recommended) or telnet and execute the following commands line by line.
#formatting
fdisk /dev/sda1
n
p
1
n
p
2
t
2
82
w
mke2fs -m 1 /dev/sda1
mkswap /dev/sda2 (if u have enough space for a swap partition..)
Prepare the files (functions.sh, libc.ipk.control, libc.ipk.list, opkg.ipk.control, opkg.ipk.list) on a another USB-Stick and plug it in too. you coud also
upload them and use wget to download them to the necessary locations, thats up to you.
cd /tmp/mnt/sda1
touch optware.enable
mkdir etc opt root bin lib usr
chmod 755 etc opt root bin lib usr
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /tmp/mnt/sda1/etc/
cp -a /bin/* /tmp/mnt/sda1/bin/
cp -a /lib/* /tmp/mnt/sda1/lib/
cp -a /usr/* /tmp/mnt/sda1/usr/
cp -a /opt/* /tmp/mnt/sda1/opt/
mkdir usr/lib/opkg
chmod 755 usr/lib/opkg
mkdir usr/lib/opkg/info
chmod 755 usr/lib/opkg/info
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/bin /bin
mount -o bind /tmp/mnt/sda1/lib /lib
mount -o bind /tmp/mnt/sda1/usr /usr
mount -o bind /tmp/mnt/sda1/opt /jffs
cd /tmp/mnt/sda1/lib
rm functions.sh
cd /tmp/mnt/sdb1/15.05
cp functions.sh /tmp/mnt/sda1/lib
cp libc.ipk.control libc.ipk.list opkg.ipk.control opkg.ipk.list /tmp/mnt/sda1/usr/lib/opkg/info
cp libc.ipk opkg.ipk /tmp
ipkg -d / install libc.ipk (wait for it to unpack and config)
ipkg -d / install opkg.ipk (wait for it to unpack and config)
cd /tmp/mnt/sda1/usr/lib/opkg/info
mv libc.ipk.control libc.control
mv libc.ipk.list libc.list
mv opkg.ipk.control opkg.control
mv opkg.ipk.list opkg.list
cd /tmp/mnt/sda1/etc
Use the PC and login to the router's webGUI and save the following startup commands (Go to Administration, Commands):
#! /bin/sh
sleep 10
if [ -f /tmp/mnt/sda1/optware.enable ]; then
mount -o bind /tmp/mnt/sda1/bin /bin
mount -o bind /tmp/mnt/sda1/etc /etc
mount -o bind /tmp/mnt/sda1/lib /lib
mount -o bind /tmp/mnt/sda1/opt /opt
mount -o bind /tmp/mnt/sda1/usr /usr
mount -o bind /tmp/mnt/sda1/root /tmp/root
sleep 2
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
Postinstall:
It might be possible that your SSH becomes corrupted after installation (it did for me). So if after reboot you get "Permission denied (publickey)"
go to your webGUI > Services > Services delete your public key and disable ssh. hit apply settings. enable ssh again, paste your ssh public key and hit
apply settings again. you should be able to ssh to your device again.