Ipkg (tutorial)

From DD-WRT Wiki

Brainslayer is working hard to merge the code base of DD-WRT with the OpenWRT firmware. This means that, for the most part, OpenWRT's package management system, ipkg, is available for DD-WRT. This allows for an easy way to add features not already in the DD-WRT firmware. Since ipkg is a command line program, you will need to either Telnet or SSH into your router to run this utility. You also need Jffs enabled.

-d <dest_name> or Install, upgrade, or remove package from <dest_name>
-dest <dest_name> where <dest_name> is '''either''' a folder path '''or''' a pre-defined
path in /etc/ipkg.conf
by default, ipkg on DD-WRT supports these pre-defined names:
root /jffs
ram /tmp
-o <offline_root> Use <offline_root> as the root for offline installation.
-offline <offline_root> where <offline_root> is a path
-force-depends Make dependency checks warnings instead of errors
-force-defaults Use default options for questions asked by ipkg.
(no prompts). Note that this will not prevent
package installation scripts from prompting.

The general steps for installing ipkg modules are as follows
-Pick a location to install to. Currently available locations are: ram (/tmp)root (the flash partition at /jffs)mmc (/mmc)smbfs (/tmp/smbshare)

Then from the command line in the jffs directory, run the following commands:

If the package you want is not in the list, substitute the URI of the package for the <packagename> you want to install.
Packages installed to ram will be deleted on reboot. There is more ram than flash space, however.jffs must be configured and initialized before packages can be installed to root

There is much confusion about LD_LIBRARY_PATH setting and some programs failing due to uClibc binary incompatibility between system provided uClibc libraries that DD-WRT provides in /lib/ directory and OpenWRT programs that require its own uClibc and is also provided as IPK package. For example http://downloads.openwrt.org/whiterussian/packages/ To assure that program will run stable one must provide compatible uClibc library to the program. It is recommended to install OpwnWRT uClibc manually with

Running OpenWRT programs also requires correct setting of the shared library search path. Default shared library search path is specified in /etc/ld.so.conf. But /etc/ld.so.conf is not used if LD_LIBRARY_PATH is set with /etc/profile. To see if LD_LIBRARY_PATH is set or no just enter

set

in console.

If unsure or if special paths are used one can also override /etc/ld.so.conf search paths with setting correct LD_LIBRARY_PATH. For example programs that reside in /jffs/bin or /jffs/sbin could be run with the following script openwrt-run.sh that should be located somewhere in the default search path.

DD-WRT now runs on a variety of hardware architectures. Some of the hardware that DD-WRT runs on is incapable of running software compiled for mipsel processors. Examples are Atheros WiSOC based hardware (e.g. LaFonera) and Intel Xscale IXP hardware (e.g. Actiontec MI424WR). If you see error messages that say "not found" or "syntax error" when you attempt to use the package you just installed, this may be your problem.

Unfortunately, as of build 13064, the ipkg.conf file in DD-WRT points to repositories that contain mipsel packages even if DD-WRT is running on incompatible hardware. If your hardware requires non-mipsel format packages you will not be able to use ipkg commands that search the web for packages (e.g. update, upgrade and search) unless you modify your ipkg.conf file. You must download the package you want and install it manually.

To install a package on non-mipsel hardware:
1) Download the .ipk file for the package you want to a convenient place on your router (e.g. /tmp). The file name will probably look like <packagename>_<version>_<hardwarename>.ipk.
2) Run ipkg -d <dest> install <filename>.ipk