Optware

From DD-WRT Wiki

Revision as of 20:06, 13 August 2006 by Oleo (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

With latest DD-WRT v23 SP2 it is possible to install Optware packages from NSLU2-Linux project. This port of Optware is tailored for DD-WRT and extends router to full feature linux if enough storrage is provided for packages (jffs, mmc, USB?).

The main feature of this packages is that it installs all required files under /opt with 400+ ported applications. With buildroot toolchain is added also system library indenpendence. This means that packages now depends od /opt/lib/uClibc.so and dynamic loader also in /opt/lib with separate /opt/etc/ld-opt.so.conf for custom .so cache. Applications are built with wchar and locale support which makes uClibc library somewhat greater than other uClibc packages, but still far smaller than glibc based aplications.

Basic preparation of /jffs is required (enable, clean). On WRT54GS there is room for some aplications. SD card (/mmc) may give enough space for many applications. For testing purposes also smbmount can be used. It should be noted that writable /jffs partition must be provided as /bin/ipkg script requires to save some data there. If non /jffs filesystem is available, it is recommended to umount /jffs and then mount eg. mmc in place od /jffs.

Example scenario of installing some packages on WRT54GS

First step is to prepare /opt mount point for Optware and create ipkg.conf file for packages download

~ # mkdir /jffs/opt
~ # mount -o bind /jffs/opt /opt 
~ # mkdir /opt/etc
~ # vi /opt/etc/ipkg.conf

Edit and insert the following content

src unslung http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable
dest root /

Now we will point /bin/ipkg script to this config with setting environment variable

~ # export IPKG_CONF_DIR=/opt/etc

This is enough to retrieve list of available packages with

~ # ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/Packages ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
Packages             100% |*************************************************************|   136 KB 00:00:00 ETA
Done.
Updated list of available packages in //jffs/usr/lib/ipkg/lists/unslung

First we will install uClibc library which is required by all packages.

~ # ipkg install uclibc
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/uclibc_0.9.28-1_mipsel.ipk ... 
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
uclibc_0.9.28-1_mips 100% |*************************************************************|   440 KB 00:00:00 ETA 
Done.
Unpacking uclibc...Done.
Configuring uclibc...Updating /opt/etc/ld-opt.so.cache
Done.

Alternatively if one wants to have C and C++ compiler to do native compiling on router, ipkg install buildroot can be issued instead. But this requires al least 100MB of free space for the whole toolchain. For running applications from /opt tree search path should be expanded with

~# export PATH=/opt/bin:/opt/sbin:$PATH 

Now we can install any package from a list of available packages.

~# ipkg list | more

or less or this Quick list of Optware packages

ncFTP client

For example we will install ncFTP client with:

~ # ipkg install ncftp
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/dd-wrt/ncftp_3.1.9-3_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
ncftp_3.1.9-3_mipsel 100% |*************************************************************|   479 KB 00:00:00 ETA
Done.
Unpacking ncftp...Done.
Configuring ncftp...Done.

and run it

~ # ncftp ftp.si.debian.org  
NcFTP 3.1.9 (Mar 24, 2005) by Mike Gleason (http://www.NcFTP.com/contact/). 
Connecting to 164.8.6.249...                    
CAMTP Debian mirror [ftp.si.debian.org]
Logging in...                                                                                                   
Anonymous access granted, restrictions apply.
Logged in to ftp.si.debian.org.                                                                                 
ncftp / > ls
backports/        debian-cd/        debian-sl/        openoffice/
debian/           debian-non-US/    favicon.ico       robots.txt
ncftp / > bye
You have not saved a bookmark for this site.
Would you like to save a bookmark to:
        ftp://ftp.si.debian.org
Save? (yes/no) yes
Enter a name for this bookmark, or hit enter for "si": debian
Bookmark "debian" saved.


Torrent clients

Of course there are many more packages which should run on router without a problem. All binaries have built in /opt/lib search path and there should be no problem with libraries clash like problems with OpenWRT packages. All packages have builtin package dependencies and will install required libraries automagically. Lets show this on installing torrent clients:

~ # ipkg install torrent
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libcurl_7.15.4-1_mipsel.ipk ...
Connecting to www.wlan-sat.com[212.18.63.81]:80
libcurl_7.15.4-1_mip 100% |*************************************************************|   518 KB 00:00:00 ETA
Done.
Unpacking libcurl...Done.
Configuring libcurl...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/openssl_0.9.7d-4_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
openssl_0.9.7d-4_mip 100% |*************************************************************|   935 KB 00:00:00 ETA
Done.
Unpacking openssl...Done.
Configuring openssl...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/zlib_1.2.3-1_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
zlib_1.2.3-1_mipsel. 100% |*************************************************************| 60760    00:00:00 ETA
Done.
Unpacking zlib...Done.
Configuring zlib...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libbt_1.05-4_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
libbt_1.05-4_mipsel. 100% |*************************************************************| 90832    00:00:00 ETA
Done.
Unpacking libbt...Done.
Configuring libbt...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/torrent_1.4-4_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
torrent_1.4-4_mipsel 100% |*************************************************************|  9851    --:--:-- ETA
Done.
Unpacking torrent...Done.
Configuring torrent...Please note that /opt/etc/init.d/S80busybox_httpd is installed for
running CGI interface at http://localhost:8008/cgi-bin/torrent.cgi
Done.
~ # ipkg install enhanced-ctorrent
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libuclibc++_0.2.0-3_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
libuclibc++_0.2.0-3_ 100% |*************************************************************| 62035    00:00:00  
Done.
Unpacking libuclibc++...Done.
Configuring libuclibc++...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libstdc++_0.1.12-3_mipsel.ipk ...
Connecting to www.wlan-sat.com[212.18.63.81]:80
libstdc++_0.1.12-3_m 100% |*************************************************************|   661    --:--:-- ETA
Done.
Unpacking libstdc++...Done.
Configuring libstdc++...Done.
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/enhanced-ctorrent_dnh2-3_mipsel.ipk ...
Connecting to ipkg.nslu2-linux.org[212.18.63.81]:80
enhanced-ctorrent_dn 100% |*************************************************************| 74675    00:00:00 ETA
Done.
Unpacking enhanced-ctorrent...Done.
Configuring enhanced-ctorrent...Done.

We will not show running example for this clients as normally huge amount of storrage is required.

Remarks

  • DD-WRT provided /bin/ipkg is not full feature ipkg but it can do the job.
  • DD-WRT kernel lacks many "server" features like NFS, USB support, ... Provided samba, mysql, thttp-php and other applications can do the job if enough space is provided. This means that external storage is required for memory hungry applications. Experience from nslu2 and Oleg firmware showed that 512MB swap space is recommended. And this can only be provided with external USB harddisk.
  • Optware for DD-WRT is alpha-stage feature. Report problems and suggestions in DD-WRT forum under Optware.
  • For instuctions on some other packages look at http://www.nslu2-linux.org/wiki/Unslung/Packages
  • Package feed will eventually change to official NSLU2 package feeds
  • Optware package tracking and repository access

Oleo