Ipkg

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (removed buildhost links (outdated article anyway))
Line 5: Line 5:
 
The practical way to install software on Openmoko is with the [http://handhelds.org/moin/moin.cgi/Ipkg Ipkg package manager], possibly via the graphical Application Manager. Naturally, you need to have obtained an Openmoko system by other means initially.
 
The practical way to install software on Openmoko is with the [http://handhelds.org/moin/moin.cgi/Ipkg Ipkg package manager], possibly via the graphical Application Manager. Naturally, you need to have obtained an Openmoko system by other means initially.
  
In the shell, "ipkg update" will update the list of available packages, "ipkg upgrade" will download and install all packages that have a newer version available and "ipkg install new-app" will download and install "new-app".
+
In the shell, "opkg update" will update the list of available packages, "opkg upgrade" will download and install all packages that have a newer version available and "ipkg install new-app" will download and install "new-app".
  
 
Have a look at [[Users Repositories]] to get addresses of alternative software repositories, e.g. ScaredyCat's ipkg repository.
 
Have a look at [[Users Repositories]] to get addresses of alternative software repositories, e.g. ScaredyCat's ipkg repository.
Line 26: Line 26:
 
''' This will erase everything on your memory card '''
 
''' This will erase everything on your memory card '''
  
umount /media/card
+
umount /media/card
fdisk /dev/mmcblk0
+
fdisk /dev/mmcblk0
t  
+
t
83
+
83
w
+
w
mke2fs /dev/mmcblk0p1
+
mke2fs /dev/mmcblk0p1
mount /media/card
+
mount /media/card
  
=== Entry in ipkg.conf File ===
+
=== Entry in opkg.conf File ===
  
In your /etc/ipkg.conf file, after "dest root /" add a new line:
+
In your /etc/opkg.conf file, after "dest root /" add a new line:
dest card /media/card/ipkg
+
dest card /media/card/opkg
  
Create /media/card/ipkg folder
+
Create /media/card/opkg folder
mkdir /media/card/ipkg
+
mkdir /media/card/opkg
  
 
=== Installing Packages on the Card ===
 
=== Installing Packages on the Card ===
  
 
When installing a package, use the -d option to have the package installed into the "card" destination:
 
When installing a package, use the -d option to have the package installed into the "card" destination:
ipkg install -d card python-core
+
opkg install -d card python-core
  
 
This will put all files (binaries and libraries) on the card, under the folder specified in the ipkg.conf file.
 
This will put all files (binaries and libraries) on the card, under the folder specified in the ipkg.conf file.
Line 51: Line 51:
 
=== Linking/Using Packages on the Card ===
 
=== Linking/Using Packages on the Card ===
  
Your system will not be able to see the packages that you just added to your card.  There are two ways to remedy this.
+
Your system will not be able to see the packages that you just added to your card.  There are two ways to remedy this.
 
The better solution is to use ipkg-link from the 'ipkg-utils' package, but 'better' is always subjective - YMMV.
 
The better solution is to use ipkg-link from the 'ipkg-utils' package, but 'better' is always subjective - YMMV.
  
Line 57: Line 57:
  
 
Ipkg-utils is a package that provides some additional functionality for ipkg.  A very useful tool is ipkg-link, which creates symbolic links for packages installed in non-root locations (such as a card) back to the root file system.
 
Ipkg-utils is a package that provides some additional functionality for ipkg.  A very useful tool is ipkg-link, which creates symbolic links for packages installed in non-root locations (such as a card) back to the root file system.
 +
 +
To make this working with Opkg, you've simply to do:
 +
ln -s /etc/opkg.conf /etc/ipkg.conf
 +
ln -s /media/card/opkg/usr/lib/opkg /media/card/opkg/usr/lib/ipkg
  
 
To get ipkg-utils, run:
 
To get ipkg-utils, run:
ipkg install ipkg-utils
+
ipkg install ipkg-utils
  
 
To create symbolic links to your root system for a specific package, run: ipkg-link add <package>.  For example, for python-core use:
 
To create symbolic links to your root system for a specific package, run: ipkg-link add <package>.  For example, for python-core use:
ipkg-link add python-core
+
ipkg-link add python-core
  
 
To create symbolic links for all packages installed in a location, run:
 
To create symbolic links for all packages installed in a location, run:
ipkg-link mount /media/card/ipkg
+
ipkg-link mount /media/card/ipkg
  
 
The ''ipkg-link remove'' and ''ipkg-link unmount'' commands remove the symlinks for a package or all packages.
 
The ''ipkg-link remove'' and ''ipkg-link unmount'' commands remove the symlinks for a package or all packages.
Line 75: Line 79:
  
 
On the line that defines the PATH variable, add:
 
On the line that defines the PATH variable, add:
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/media/card/ipkg/usr/bin
+
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/media/card/ipkg/usr/bin
  
 
Then, before the 'export' line add:
 
Then, before the 'export' line add:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/media/card/ipkg/usr/lib
+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/media/card/ipkg/usr/lib
  
 
Then modify the 'export' line and add LD_LIBRARY_PATH to the end.
 
Then modify the 'export' line and add LD_LIBRARY_PATH to the end.
  
 
This will let the system see the binary and library files, but it will not see other resources, such as images, configuration files, desktop files, etc.  For this reason, ipkg-link is preferred.
 
This will let the system see the binary and library files, but it will not see other resources, such as images, configuration files, desktop files, etc.  For this reason, ipkg-link is preferred.

Revision as of 22:53, 12 October 2008

NB: Current (2008-04-04+) builds of Openmoko now come with the syntax compatible Opkg tool, not ipkg.

TODO: Integrate useful content into Opkg as a usage section. (See: To-Do List)

The practical way to install software on Openmoko is with the Ipkg package manager, possibly via the graphical Application Manager. Naturally, you need to have obtained an Openmoko system by other means initially.

In the shell, "opkg update" will update the list of available packages, "opkg upgrade" will download and install all packages that have a newer version available and "ipkg install new-app" will download and install "new-app".

Have a look at Users Repositories to get addresses of alternative software repositories, e.g. ScaredyCat's ipkg repository.

Contents

History

Ipkg re-implements for embedded systems the functionality of Debian tools dpkg, apt, and apt-get. For example, it uses much less disk space for the package metadata.

Installing Packages to the Memory Card

You can use ipkg to install packages to a folder on the memory card. To do this you'll need the following:

Ext2 Formatted Memory Card

By default, the memory card comes formated with VFAT (Windows Format). You need to re-format the card with EXT2. You will not be able to view the files on the card using a windows system after this.

To check if your card is using vfat or ext, run the 'mount' command, and look for: /dev/mmcblk0p1 on /media/card.

On the NEO, run the following: This will erase everything on your memory card

umount /media/card fdisk /dev/mmcblk0 t 83 w mke2fs /dev/mmcblk0p1 mount /media/card

Entry in opkg.conf File

In your /etc/opkg.conf file, after "dest root /" add a new line: dest card /media/card/opkg

Create /media/card/opkg folder mkdir /media/card/opkg

Installing Packages on the Card

When installing a package, use the -d option to have the package installed into the "card" destination: opkg install -d card python-core

This will put all files (binaries and libraries) on the card, under the folder specified in the ipkg.conf file.

Linking/Using Packages on the Card

Your system will not be able to see the packages that you just added to your card. There are two ways to remedy this. The better solution is to use ipkg-link from the 'ipkg-utils' package, but 'better' is always subjective - YMMV.

1: Ipkg Utils and ipkg-link

Ipkg-utils is a package that provides some additional functionality for ipkg. A very useful tool is ipkg-link, which creates symbolic links for packages installed in non-root locations (such as a card) back to the root file system.

To make this working with Opkg, you've simply to do: ln -s /etc/opkg.conf /etc/ipkg.conf ln -s /media/card/opkg/usr/lib/opkg /media/card/opkg/usr/lib/ipkg

To get ipkg-utils, run: ipkg install ipkg-utils

To create symbolic links to your root system for a specific package, run: ipkg-link add <package>. For example, for python-core use: ipkg-link add python-core

To create symbolic links for all packages installed in a location, run: ipkg-link mount /media/card/ipkg

The ipkg-link remove and ipkg-link unmount commands remove the symlinks for a package or all packages.

There is a list of the options for the ipkg command under "How do I use it?" here.

2: Adding the card PATH and LIB directories to your path

Another way to add bin and lib files to your system is by modifying your environment variables in /etc/profile as follows:

On the line that defines the PATH variable, add: PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/media/card/ipkg/usr/bin

Then, before the 'export' line add: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/media/card/ipkg/usr/lib

Then modify the 'export' line and add LD_LIBRARY_PATH to the end.

This will let the system see the binary and library files, but it will not see other resources, such as images, configuration files, desktop files, etc. For this reason, ipkg-link is preferred.

Personal tools

NB: Current (2008-04-04+) builds of Openmoko now come with the syntax compatible Opkg tool, not ipkg.

TODO: Integrate useful content into Opkg as a usage section. (See: To-Do List)

The practical way to install software on Openmoko is with the Ipkg package manager, possibly via the graphical Application Manager. Naturally, you need to have obtained an Openmoko system by other means initially.

In the shell, "opkg update" will update the list of available packages, "opkg upgrade" will download and install all packages that have a newer version available and "ipkg install new-app" will download and install "new-app".

Have a look at Users Repositories to get addresses of alternative software repositories, e.g. ScaredyCat's ipkg repository.

History

Ipkg re-implements for embedded systems the functionality of Debian tools dpkg, apt, and apt-get. For example, it uses much less disk space for the package metadata.

Installing Packages to the Memory Card

You can use ipkg to install packages to a folder on the memory card. To do this you'll need the following:

Ext2 Formatted Memory Card

By default, the memory card comes formated with VFAT (Windows Format). You need to re-format the card with EXT2. You will not be able to view the files on the card using a windows system after this.

To check if your card is using vfat or ext, run the 'mount' command, and look for: /dev/mmcblk0p1 on /media/card.

On the NEO, run the following: This will erase everything on your memory card

umount /media/card fdisk /dev/mmcblk0 t 83 w mke2fs /dev/mmcblk0p1 mount /media/card

Entry in opkg.conf File

In your /etc/opkg.conf file, after "dest root /" add a new line: dest card /media/card/opkg

Create /media/card/opkg folder mkdir /media/card/opkg

Installing Packages on the Card

When installing a package, use the -d option to have the package installed into the "card" destination: opkg install -d card python-core

This will put all files (binaries and libraries) on the card, under the folder specified in the ipkg.conf file.

Linking/Using Packages on the Card

Your system will not be able to see the packages that you just added to your card. There are two ways to remedy this. The better solution is to use ipkg-link from the 'ipkg-utils' package, but 'better' is always subjective - YMMV.

1: Ipkg Utils and ipkg-link

Ipkg-utils is a package that provides some additional functionality for ipkg. A very useful tool is ipkg-link, which creates symbolic links for packages installed in non-root locations (such as a card) back to the root file system.

To make this working with Opkg, you've simply to do: ln -s /etc/opkg.conf /etc/ipkg.conf ln -s /media/card/opkg/usr/lib/opkg /media/card/opkg/usr/lib/ipkg

To get ipkg-utils, run: ipkg install ipkg-utils

To create symbolic links to your root system for a specific package, run: ipkg-link add <package>. For example, for python-core use: ipkg-link add python-core

To create symbolic links for all packages installed in a location, run: ipkg-link mount /media/card/ipkg

The ipkg-link remove and ipkg-link unmount commands remove the symlinks for a package or all packages.

There is a list of the options for the ipkg command under "How do I use it?" here.

2: Adding the card PATH and LIB directories to your path

Another way to add bin and lib files to your system is by modifying your environment variables in /etc/profile as follows:

On the line that defines the PATH variable, add: PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/media/card/ipkg/usr/bin

Then, before the 'export' line add: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/media/card/ipkg/usr/lib

Then modify the 'export' line and add LD_LIBRARY_PATH to the end.

This will let the system see the binary and library files, but it will not see other resources, such as images, configuration files, desktop files, etc. For this reason, ipkg-link is preferred.