Ipkg

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Installing Packages on the Card)
(ipkg breaks kernels)
Line 12: Line 12:
 
Ipkg re-implements for embedded systems the Debian tools dpkg, apt, and apt-get. For example, it uses much less disk space for the package metadata.
 
Ipkg re-implements for embedded systems the Debian tools dpkg, apt, and apt-get. For example, it uses much less disk space for the package metadata.
  
 +
== Ipkg Breaks Kernels ==
 +
 +
Unfortunately, ipkg has a bug; it tries to install kernels (and does actually install the kernel modules), but the kernel is on a separate partition that isn't normally mounted.  So when you do "ipkg upgrade" and kernel packages get installed, your system breaks (the modules no longer match the kernel).  For example, sound no longer worked for me.
 +
 +
To fix this, you have to find a kernel image somewhere else (I don't know how to tell you how to find that -- on IRC, mentax suggested installing http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/uImage-2.6.22.5-moko11+svnr2937-r2-fic-gta01.bin
 +
(but that advice is probably obsolete by the time you read it.)  Once you have a kernel partition image that matches the modules installed by ipkg, you can install the kernel by powering off the phone and following the advice in [[Flashing_openmoko]].
 +
 +
It seems to me that ipkg should be able to flash the kernel partition -- but nobody's made it do so, yet.
  
 
== Installing Packages to the Memory Card ==
 
== Installing Packages to the Memory Card ==

Revision as of 19:42, 25 September 2007

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.

For the latest ipk package files from buildhost put the following lines in your /etc/ipkg/base-feed.conf:

src/gz all http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/all/
src/gz armv4t http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/armv4t/
src/gz fic-gta01 http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/fic-gta01/

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

Contents

History

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

Ipkg Breaks Kernels

Unfortunately, ipkg has a bug; it tries to install kernels (and does actually install the kernel modules), but the kernel is on a separate partition that isn't normally mounted. So when you do "ipkg upgrade" and kernel packages get installed, your system breaks (the modules no longer match the kernel). For example, sound no longer worked for me.

To fix this, you have to find a kernel image somewhere else (I don't know how to tell you how to find that -- on IRC, mentax suggested installing http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/uImage-2.6.22.5-moko11+svnr2937-r2-fic-gta01.bin (but that advice is probably obsolete by the time you read it.) Once you have a kernel partition image that matches the modules installed by ipkg, you can install the kernel by powering off the phone and following the advice in Flashing_openmoko.

It seems to me that ipkg should be able to flash the kernel partition -- but nobody's made it do so, yet.

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
q
mke2fs /dev/mmcblk0p1
mount /media/card

Entry in ipkg.conf File

In your ipkg.conf file, after "dest root /" add a new line:

dest card /media/card/ipkg

Create /media/card/ipkg folder

mkdir /media/card/ipkg

Installing Packages on the Card

When installing a package, use the -d option to have in installed on the card:

ipkg 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. Your system will not be able to see these files, and you must add the BIN and LIB folders to your path.

One way to add bin and lib files to your system is by modifying /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. A better solution is to use ipkg-link from the 'ipkg-utils' package.

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

Ipkg Utils and ipkg-link

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

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

Personal tools

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.

For the latest ipk package files from buildhost put the following lines in your /etc/ipkg/base-feed.conf:

src/gz all http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/all/
src/gz armv4t http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/armv4t/
src/gz fic-gta01 http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/ipk/fic-gta01/

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

History

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

Ipkg Breaks Kernels

Unfortunately, ipkg has a bug; it tries to install kernels (and does actually install the kernel modules), but the kernel is on a separate partition that isn't normally mounted. So when you do "ipkg upgrade" and kernel packages get installed, your system breaks (the modules no longer match the kernel). For example, sound no longer worked for me.

To fix this, you have to find a kernel image somewhere else (I don't know how to tell you how to find that -- on IRC, mentax suggested installing http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/fic-gta01/uImage-2.6.22.5-moko11+svnr2937-r2-fic-gta01.bin (but that advice is probably obsolete by the time you read it.) Once you have a kernel partition image that matches the modules installed by ipkg, you can install the kernel by powering off the phone and following the advice in Flashing_openmoko.

It seems to me that ipkg should be able to flash the kernel partition -- but nobody's made it do so, yet.

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
q
mke2fs /dev/mmcblk0p1
mount /media/card

Entry in ipkg.conf File

In your ipkg.conf file, after "dest root /" add a new line:

dest card /media/card/ipkg

Create /media/card/ipkg folder

mkdir /media/card/ipkg

Installing Packages on the Card

When installing a package, use the -d option to have in installed on the card:

ipkg 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. Your system will not be able to see these files, and you must add the BIN and LIB folders to your path.

One way to add bin and lib files to your system is by modifying /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. A better solution is to use ipkg-link from the 'ipkg-utils' package.

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

Ipkg Utils and ipkg-link

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

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