Ipkg (tutorial)

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:03, 17 September 2006 (edit)
Atzekalle (Talk | contribs)

← Previous diff
Revision as of 23:40, 2 October 2006 (edit) (undo)
Whiteboy (Talk | contribs)
(introduction style + minor edits)
Next diff →
Line 1: Line 1:
-=Introduction= 
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/SSH and the Command Line|Telnet or SSH]] into your router to run this utility. You also need [[Jffs]] enabled. 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/SSH and the Command Line|Telnet or SSH]] into your router to run this utility. You also need [[Jffs]] enabled.
-=Commandline Structure=+= Commandline Structure =
-==Usage==+== Usage ==
usage: ipkg [options...] sub-command [arguments...] usage: ipkg [options...] sub-command [arguments...]
-==Options==+== Options ==
<pre>-d <dest_name> or Install, upgrade, or remove package from <dest_name> <pre>-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 -dest <dest_name> where <dest_name> is '''either''' a folder path '''or''' a pre-defined
Line 23: Line 22:
package installation scripts from prompting.</pre> package installation scripts from prompting.</pre>
-==Sub Commands==+== Sub Commands ==
<pre> <pre>
update Update list of available packages from <src> defined in /etc/ipkg.conf update Update list of available packages from <src> defined in /etc/ipkg.conf
Line 40: Line 39:
</pre> </pre>
-=Finding Packages=+= Finding Packages =
[http://www.OpenWrt.org OpenWRT.org] hosts a list of [http://openwrt.org/OpenWrtPackages Official Packages], as well as a [http://tracker.openwrt.org/ Package Tracker] and [http://openwrt.alphacore.net/ openwrt.alphacore.net] listing all known packages. Packages from the tracker will usually have to be installed by using &lt;pkg&gt; as a URI rather than a package name, unless you've updated your /etc/ipkg.conf file to point to a different [http://nthill.free.fr/openwrt/tracker/repositories/ repository]. [http://www.OpenWrt.org OpenWRT.org] hosts a list of [http://openwrt.org/OpenWrtPackages Official Packages], as well as a [http://tracker.openwrt.org/ Package Tracker] and [http://openwrt.alphacore.net/ openwrt.alphacore.net] listing all known packages. Packages from the tracker will usually have to be installed by using &lt;pkg&gt; as a URI rather than a package name, unless you've updated your /etc/ipkg.conf file to point to a different [http://nthill.free.fr/openwrt/tracker/repositories/ repository].
Another source of software for the wrt is here [http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/ ipkg.nslu2-linux.org], most of the files in this directory works fine on DD-WRT. Another source of software for the wrt is here [http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/ ipkg.nslu2-linux.org], most of the files in this directory works fine on DD-WRT.
-=Installing ipkg packages=+= Installing ipkg Packages =
''The general steps for installing ipkg modules are as follows''<br> ''The general steps for installing ipkg modules are as follows''<br>
-Pick a location to install to. Currently available locations are: <br> -Pick a location to install to. Currently available locations are: <br>
Line 71: Line 70:
ipkg -d ram install http://www.ramereth.net/openwrt/ipkg/noip_1.6.0_mipsel.ipk ipkg -d ram install http://www.ramereth.net/openwrt/ipkg/noip_1.6.0_mipsel.ipk
-=Starting programs/daemons=+ 
 += Starting Programs/Daemons =
If you installed some daemons you need to manually activate them, because the openwrt /etc/init.d/ startup method is not (yet?) implemented. One possibility would be to If you installed some daemons you need to manually activate them, because the openwrt /etc/init.d/ startup method is not (yet?) implemented. One possibility would be to
nvram set rc_startup=/jffs/etc/init.d/* nvram set rc_startup=/jffs/etc/init.d/*
Line 78: Line 78:
For further Information see [[Startup Scripts]]. For further Information see [[Startup Scripts]].
-=What if your jffs partition is full (routers with NO JFFS space avail)=+= What if your jffs partition is full (routers with NO JFFS space avail) =
You have to enable [[jffs]] anyway even if it is useless... and to create some required directory in your [[Samba]]share: You have to enable [[jffs]] anyway even if it is useless... and to create some required directory in your [[Samba]]share:
Line 99: Line 99:
which you can safely ignore. which you can safely ignore.
-=Installing an ipkg on startup=+= Installing an ipkg on Startup =
Since the available RAM is larger, is it possible to set up a startup script to install an ipkg? Since the available RAM is larger, is it possible to set up a startup script to install an ipkg?
That way, each time it's rebooted the router will automatically download and install the ipkg we need. That way, each time it's rebooted the router will automatically download and install the ipkg we need.
Line 105: Line 105:
One way to accomplish this is to write a [[Startup Scripts|startup script]] One way to accomplish this is to write a [[Startup Scripts|startup script]]
-=External Resources=+= Links =
[http://forum.bsr-clan.de/viewtopic.php?t=1376&sid=91405eea5aa49dc5348a614959010de7 Installing ipkg on DD-WRT] [http://forum.bsr-clan.de/viewtopic.php?t=1376&sid=91405eea5aa49dc5348a614959010de7 Installing ipkg on DD-WRT]
- 
[http://www.linksysinfo.org/portal/forums/showthread.php?t=36018 Guide for installing maiu IRC bouncer on the WRT using ipkg] [http://www.linksysinfo.org/portal/forums/showthread.php?t=36018 Guide for installing maiu IRC bouncer on the WRT using ipkg]
[[Category:advanced HOWTO]] [[Category:advanced HOWTO]]
- 
[[Category:English documentation]] [[Category:English documentation]]

Revision as of 23:40, 2 October 2006

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.

Contents

Commandline Structure

Usage

usage: ipkg [options...] sub-command [arguments...]

Options

-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.

Sub Commands

update                  Update list of available packages from <src> defined in /etc/ipkg.conf
upgrade                 Upgrade all installed packages to latest version
install <pkg>           Download and install <pkg> (and dependencies)
remove <pkg>            Remove package <pkg>
list                    List available packages and descriptions
files <pkg>             List all files belonging to <pkg>
search <file>           Search for a packaging providing <file>
info [pkg [<field>]]    Display all/some info fields for <pkg> or all
status [pkg [<field>]]  Display all/some status fields for <pkg> or all
depends <pkg>           Print uninstalled package dependencies for <pkg>

 - <pkg> may be a package name, or a URI to the *.ipk or *.deb file
 - arguments displayed in [ ] are optional

Finding Packages

OpenWRT.org hosts a list of Official Packages, as well as a Package Tracker and openwrt.alphacore.net listing all known packages. Packages from the tracker will usually have to be installed by using <pkg> as a URI rather than a package name, unless you've updated your /etc/ipkg.conf file to point to a different repository.

Another source of software for the wrt is here ipkg.nslu2-linux.org, most of the files in this directory works fine on DD-WRT.

Installing ipkg Packages

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, run the following commands:

 ipkg update # pulls latest list of package listing from the default sites.
 ipkg list # gives the list of ipkg's available
 ipkg -d <location> install <packagename> # installs the package of your choice

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 install to root

Ex: to install the noip package to ram:

   ipkg update
   ipkg list

Since noip is not in the list, see Finding Packages

   ipkg -d ram install http://www.ramereth.net/openwrt/ipkg/noip_1.6.0_mipsel.ipk

Starting Programs/Daemons

If you installed some daemons you need to manually activate them, because the openwrt /etc/init.d/ startup method is not (yet?) implemented. One possibility would be to

nvram set rc_startup=/jffs/etc/init.d/*

Or use the Samba-Startup script.

For further Information see Startup Scripts.

What if your jffs partition is full (routers with NO JFFS space avail)

You have to enable jffs anyway even if it is useless... and to create some required directory in your Sambashare:

~# mkdir -p /tmp/smbshare/tmp/ipkg

Download then the packages directly to your Samba share and type:

~# ipkg -d smbfs install /tmp/smbshare/directory/package.ipk

or download and install at the same time with the same command:

~# ipkg -d smbfs install http://www.ramereth.net/openwrt/ipkg/noip_1.6.0_mipsel.ipk

You should see some warning messages like these ones:

ERROR: File not found: //jffs/usr/lib/ipkg/lists/whiterussian
       You probably want to run `ipkg update'
ERROR: File not found: //jffs/usr/lib/ipkg/lists/non-free
       You probably want to run `ipkg update'

which you can safely ignore.

Installing an ipkg on Startup

Since the available RAM is larger, is it possible to set up a startup script to install an ipkg? That way, each time it's rebooted the router will automatically download and install the ipkg we need.

One way to accomplish this is to write a startup script

Links

Installing ipkg on DD-WRT Guide for installing maiu IRC bouncer on the WRT using ipkg