Install Optware on DD-Wrt (WNDR3700v2/MIPS)

Please read the following instructions before taking any action. That will be good for you getting used to them.


0. Hardware and Prerequisites

0.0 TP-Link WDR3600-N600 – v1.1: Have DD-WRT Build in between 25408 and 30731, flashed and working .

0.0.1 Also Works with the following devices (not tested, but reported):

  • TP Link WDR4300
  • TP Link Archer C7
  • Netgear WNDR3700

0.1 PuTTY and WinSCP: Google, download and make them ready for use.

0.2 Kingston 16GB – DT101/G2: Create two partitions on the USB thumbdrive, using MiniTool Partition Wizard for example.

0.2.1 First Partition

  • Partition Size : 14 GB (unallocated space)
  • File System : NTFS or EXT3
  • Create As : Primary
  • Partition Label: Data (or whatever label you want to, but Optware)

0.2.2 Second Partition

  • Partition Size : 100 MB
  • File System : NTFS or EXT3
  • Create As : Primary
  • Partition Label: System (or whatever label you want to, but Optware)

0.3 DD-WRT Web Interface

0.3.1 Enable SSH (SSHd): [Services] > [Services] > [Secure Shell]

0.3.2 Enable Samba Sharing: [Services] > [NAS]

0.4 Router: stick the USB thumbdrive on router and reboot it.

0.5 Wait few seconds. Then make sure both [mnt/sda1] and [mnt/sda2] are mounted on the router and shared by Samba (from DD-WRT Web Interface)


1. Optware

1.1 Run the following line-by-line, using PuTTY:

Code:

cd /tmp/mnt/sda1
touch .optware.enable
cd /tmp/mnt/sda2
mkdir etc opt root bin lib usr
touch .optware.enable
chmod 755 etc opt root bin lib usr
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /tmp/mnt/sda2/etc/
cp -a /bin/* /tmp/mnt/sda2/bin/
cp -a /lib/* /tmp/mnt/sda2/lib/
cp -a /usr/* /tmp/mnt/sda2/usr/
sleep 5
mount -o bind /tmp/mnt/sda2/etc /etc
mount -o bind /tmp/mnt/sda2/bin /bin
mount -o bind /tmp/mnt/sda2/lib /lib
mount -o bind /tmp/mnt/sda2/usr /usr
mount -o bind /tmp/mnt/sda2/opt /jffs

1.1.1 Download, extract the following “functions.zip” file and copy “functions.sh” file to [/tmp/mnt/sda2/lib/] directory:

Download functions.zip – In case of broken link: attachments at the end of this post. Or create the file: http://pastebin.com/Unw9Nynf

[Note] If a “Read-only file system” error occours, you’ll have either rename the existing “functions.sh” to “functions.sh_” or delete it before copying your downloaded file.

1.1.2 Run the following line-by-line, using PuTTY:

Code:

cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/uclibcxx_0.2.4-2_ar71xx.ipk
wget http://archive.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/libc_1.1.16-1_ar71xx.ipk
wget http://archive.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-15_ar71xx.ipk
ipkg -d / -force-depends install uclibcxx_0.2.4-2_ar71xx.ipk
ipkg -d / install  libc_1.1.16-1_ar71xx.ipk 
ipkg -d / install  opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-15_ar71xx.ipk  

You should see:
Quote:

Connecting to downloads.openwrt.org (78.24.191.177:80)
uclibcxx_0.2.4-2_ar7 100% |***| 70627 0:00:00 ETA

Connecting to downloads.openwrt.org (78.24.191.177:80)
libc_1.1.14-1_ar71xx 100% |***| 268k 0:00:00 ETA

Connecting to downloads.openwrt.org (78.24.191.177:80)
opkg_9c97d5ecd795709 100% |***| 55699 0:00:00 ETA

ipkg_depends: ERROR: Package name uclibcxx_0.2.4-2_ar71xx.ipk contains illegal characters (should be [a-z0-9.+-])
Unpacking uclibcxx_0.2.4-2_ar71xx.ipk…Done.
Configuring uclibcxx_0.2.4-2_ar71xx.ipk…Done.

ipkg_depends: ERROR: Package name libc_1.1.14-1_ar71xx.ipk contains illegal characters (should be [a-z0-9.+-])
Unpacking libc_1.1.14-1_ar71xx.ipk…Done.
Configuring libc_1.1.14-1_ar71xx.ipk…Done.

ERROR: File not found: //usr/local/lib/ipkg/lists/barrier_breaker
You probably want to run `ipkg update'
Unpacking opkg…Done.
Configuring opkg…Done.

For “ipkg: not found” error, pls find this topic, download and extract older firmware then copy ipkg executable and ipkg.conf file to /mnt/sda2/bin/ and /mnt/sda2/etc/ .

Code:

cat > /etc/opkg.conf << EOF
src/gz packages http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages
src/gz base http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base
dest root /opt
dest ram /opt/tmp
lists_dir ext /opt/tmp/var/opkg-lists
EOF

Code:

umount /jffs
mount -o bind /tmp/mnt/sda2/opt /opt
mount -o bind /tmp/mnt/sda2/root /tmp/root
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update

You should see:
Quote:

Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/packages.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base//Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/base.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_base.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/kernel/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_kernel.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/luci/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_luci.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/management/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_management.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_packages.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/routing/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_routing.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/telephony/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_telephony.

Code:

cat > /tmp/mnt/sda2/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]\[email protected]\h [\033[01;34m]\w \$ [\033[00m]'
export TERMINFO='/opt/usr/share/terminfo'
EOF

1.2 Paste the following on DD-WRT Web interface, Administration – Commands. Click “Save Startup”.

Code:

! /bin/sh
sleep 10
  if [ -f /mnt/sda1/.optware.enable ]; then
   if [ -f /mnt/sda2/.optware.enable ]; then
     mount -o bind /tmp/mnt/sda2/bin  /bin
     mount -o bind /tmp/mnt/sda2/etc  /etc
     mount -o bind /tmp/mnt/sda2/lib  /lib
     mount -o bind /tmp/mnt/sda2/opt  /opt
     mount -o bind /tmp/mnt/sda2/usr  /usr
     mount -o bind /tmp/mnt/sda2/root /tmp/root
    sleep 2
   else
    exit
   fi
  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 

1.3 Reboot the router.

1.4 Using PuTTY, you should see a colorful prompt (in red and blue). Run the following:

Code:

opkg update

You should see:
Quote:

http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/packages.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base//Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/base.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_base.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/kernel/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_kernel.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/luci/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_luci.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/management/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_management.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_packages.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/routing/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_routing.
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/telephony/Packages.gz.
Updated list of available packages in /opt/tmp/var/opkg-lists/designated_driver_telephony.

1.5 Preventing “Segmentation fault” error:

1.5.1 Run the following, using PuTTY:

Code:

cd /tmp
wget http://downloads.openwrt.org/barrier_breaker/14.07-rc3/ar71xx/generic/packages/libc_0.9.33.2-1_ar71xx.ipk
opkg install libc_0.9.33.2-1_ar71xx.ipk

You should see:
Quote:

Connecting to downloads.openwrt.org (78.24.191.177:80)

libc_0.9.33.2-1_ar71 100% |***| 219k 0:00:00 ETA

 Installing libc (0.9.33.2-1) to root…
 Installing libgcc (5.3.0-1) to root…
 Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/libgcc_5.3.0-1_ar71xx.ipk.
 Configuring libgcc.
 Configuring libc. 

2. MiniDLNA

3. Transmission

4. Troubleshooting: Web Interface misconfigured after DD-WRT Upgrade

5. Known Issues and improvements

6. Backup and Restore – DO NOT SHARE your archive files!

7. Alternative Repositories

please refer to https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=177532

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.