Daily Archives: 17.4.2013

You are browsing the site archives by date.

Simple Opkg Tutorial

In order to show you how to use the new advanced opkg software package manager that is included in my builds. I’m going to explain how to setup and use opkg to extend your routers functionality.

Here are the steps in order to prepare your router for opkg:

  1. Prepare a usb drive with at least one ext2/ext3 partition: You can use any Windows partition software or linux live system to do that e.g.  http://gparted.sourceforge.net/
  2. Attach the usb drive to your router and setup Services->USB.  Once the drive shows up under Disk Info, copy and paste the UUID of the partition into the Mount this Partition to /opt text field
  3. Reboot the router
  4. The drive should be mounted to /opt now , you can verify this by looking at the Disk Info output

Lets work with Opkg now:

Login to the router via telnet or ssh:

  1. Retrieve the list of available packages, by executing command opkg update
  2. List available packages opkg list
  3. Search for some extra editor e.g. opkg list | grep editor
  4. Install editor nano opkg install nano
  5. Run nano by executing nano. Oops you will see Error opening terminal: xterm. Well the reason for this is by default no terminfo is set, so lets do that by entering command export TERMINFO=/opt/usr/share/terminfo into you console window. Now start nano again

Opkg of course can do a few more things. Thus just execute opkg without arguments and look at the options in order to list/remove installed packages etc.

At this time you should have a basic understanding of opkg package management. Opkg will store packages config files etc. under /opt. Some packages come along with config files that you need to edit in order to make them work in the way you want them, just search under /opt/etc for these files.

*Note: The default package url that is included in my build points to the openwrt repository. Since these packages have been compiled with the openwrt sdk not all packages will work under dd-wrt. This comes from the fact, that dd-wrt uses a modified ethernet structure header and packages that were not compiled with the dd-wrt sdk cannot query all ethernet infos and will fail to get details about the existing interfaces e.g. ushare is affected by this.