EA6500 v1 optware using repository from openwrt Chaos Calmer

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Sat Feb 27, 2016 11:57    Post subject: EA6500 v1 optware using repository from openwrt Chaos Calmer Reply with quote
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:

/lib/functions.sh
/usr/lib/opkg/info/libc.control
/usr/lib/opkg/info/libc.list
/usr/lib/opkg/info/opkg.control
/usr/lib/opkg/info/opkg.list

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

I am using the Firmware Modification Kit from dd-wrt for extracting the files from the image. There is a wiki on this subject: https://www.dd-wrt.com/wiki/index.php/Development

After you get the above files, you have to rename the control and list files to libc.ipk.control, libc.ipk.list, opkg.ipk.control and opkg.ipk.list

I also downloaded libc_0.9.33.2-1_brcm47xx.ipk and opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7_brcm47xx.ipk from https://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/base/ and rename the files to libc.ipk and opkg.ipk

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:

dest root /tmp/mnt/sda1
dest ram /tmp
lists_dir ext /opt/tmp/var/opkg-lists
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/luci
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/telephony
src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/management

and then save the file.

Back to putty and enter the following commands:

umount /jffs
mount -o bind /tmp/mnt/sda1/opt /opt
mount -o bind /tmp/mnt/sda1/root /tmp/root
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update
opkg install libc.ipk
opkg install uclibcxx

cat > /tmp/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

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.

Have fun and enjoy!
Sponsor
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Sun Oct 16, 2016 1:31    Post subject: extracting the firmware Reply with quote
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.

im DD-WRT v3.0-r30731 big with a asus rt-n66u.

downloaded fresh:
openwrt-15.05.1-brcm47xx-mips74k-asus-rt-n66u-squashfs.trx

and tried to extract using:

https://code.google.com/archive/p/firmware-mod-kit/wikis/Documentation.wiki

after completion > "error wrong filesystem"

try was on ubuntu 16.10 on a ext4 partition.

would appreciate ur help

btw: if u followed: https://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

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.

i also found this: https://g300nh.blogspot.de/2010/06/software-installation-on-dd-wrt-part-1.html

and this: https://g300nh.blogspot.de/2010/06/software-installation-on-dd-wrt-part-2.html

but its very old..
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Sun Oct 16, 2016 2:19    Post subject: Reply with quote
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.
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Sun Oct 16, 2016 11:08    Post subject: Reply with quote
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
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Sun Oct 16, 2016 17:23    Post subject: opkg Reply with quote
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?

code:
Collected errors:
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/base). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/luci). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/packages). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/routing). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/telephony). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/management). Skipping.

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?

i partitioned my 32GB sd card acc. to this wiki:
https://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

partition-layout and labels are:
/dev/sdb1 - 4GB - Optware
/dev/sdb2 - 1GB - Swapfile
/dev/sdb3 - 2 GB - JFFS
/dev/sdb4 - 21 GB - Data

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.

gui-screenshot:
http://pix.toile-libre.org/upload/original/1476640451.png
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Mon Oct 17, 2016 1:41    Post subject: Reply with quote
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
Brimmy
DD-WRT User


Joined: 29 Mar 2015
Posts: 398

PostPosted: Mon Oct 17, 2016 11:24    Post subject: Reply with quote
Hi, noob questions here...

exactly what does optware do? Do you need to reinstall it with every firmware change? Does it introduce any latency?
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Mon Oct 17, 2016 12:29    Post subject: Reply with quote
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.
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Mon Oct 17, 2016 12:36    Post subject: Reply with quote
Btw if you find my approach is a bit complicated and hard to follow, there is other alternative such as entware-ng
Brimmy
DD-WRT User


Joined: 29 Mar 2015
Posts: 398

PostPosted: Mon Oct 17, 2016 14:51    Post subject: Reply with quote
I thought this was only on openwrt.

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"

Thanks for the information.
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Mon Oct 17, 2016 23:11    Post subject: start from scratch Reply with quote
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

cat > opkg.conf << EOF
dest root /tmp/mnt/sda1
dest ram /tmp
lists_dir ext /opt/tmp/var/opkg-lists
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/luci
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/telephony
src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/management
EOF

umount /jffs
mount -o bind /tmp/mnt/sda1/opt /opt
mount -o bind /tmp/mnt/sda1/root /tmp/root
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update **error double parse**
opkg install libc.ipk **error double parse**
opkg install uclibcxx **error double parse**

cat > /tmp/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

**REBOOT**

opkg update

**error double parse**

code:
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/base/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_base.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/luci/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_luci.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/packages/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_packages.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/routing/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_routing.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/telephony/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_telephony.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/management/Packages.gz.
Updated list of available packages in /usr/lib/opkg/lists/chaos_calmer_management.
Collected errors:
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/base). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/luci). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/packages). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/routing). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/telephony). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05.1/brcm47xx/mips74k/packages/management). Skipping.
js1662
DD-WRT Guru


Joined: 23 Jul 2014
Posts: 1237
Location: BC, CA

PostPosted: Mon Oct 17, 2016 23:50    Post subject: Reply with quote
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.
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Sun Oct 23, 2016 20:28    Post subject: working with 15.05 Reply with quote
confirmed working with the files from 15.05. it does not work with 15.05.1.

great work with this tut, thank you very much.

do you leave JFFS enabled after installation? it seems logical to deactivate it as it doesn't seem to be necessary anymore.

can i use ipkg too without worries or will it corrupt stuff?

im trying to follow this (
https://wiki.openwrt.org/doc/howto/timemachine) guide and i encounter problems using the packages shadow-useradd, shadow-groupadd and sudo.

when i do groupadd blah blah i get
cannot open /etc/group
when i install sudo i get
/bin/sh can't open /etc/rc.common

can you hint me?


Last edited by rwst on Sun Oct 23, 2016 21:26; edited 3 times in total
rwst
DD-WRT Novice


Joined: 15 Oct 2016
Posts: 8

PostPosted: Sun Oct 23, 2016 20:30    Post subject: Optimized tutorial for lazy people :) Reply with quote
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.

files:: https://files.fm/u/xm8ejmkb#/view/files+from+15.05.zip

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

cat > opkg.conf << EOF
dest root /tmp/mnt/sda1
dest ram /tmp
lists_dir ext /opt/tmp/var/opkg-lists
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/luci
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/telephony
src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05/brcm47xx/mips74k/packages/management
EOF


umount /jffs
cd /tmp
mount -o bind /tmp/mnt/sda1/opt /opt
mount -o bind /tmp/mnt/sda1/root /tmp/root
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update
opkg install libc.ipk
opkg install uclibcxx

cat > /tmp/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



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.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    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