Add Packages To Ubuntu Preinstalled Images

From OMAPpedia

Revision as of 14:08, 14 September 2010 by Michael Opdenacker (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ubuntu delivers pre-installed images for OMAP3 and OMAP4, in particular on

These images are much faster to install (10 to 20 minutes) than standard "live" images (up to several hours). That's why these images for shipped by default. See this page for details.

Here are instructions to add your own packages to the pre-installed images. They assume that sufficient space is available. At the moment, the pre-installed root partition has 200-300 MB of free space.



You need to run the below manipulations on an armv7 board (like OMAP3 and OMAP4 ones) running a GNU/Linux distribution. That's because we are going to chroot to an armv7 rootfs.

Mounting the pre-installed rootfs

Run fdisk -lu file and read the starting block for the rootfs partition:

Now, mount this partition:

mount -o loop,offset=$((start*512)) ubuntu.img /mnt/rootfs

Modifying the pre-installed partition

Before running chroot, replicate the basic filesystems that Ubuntu mounts:

for f in /proc /sys /dev /dev/pts /dev/shm /var/run /var/lock
  sudo mount -o bind $f /mnt/rootfs/$f

Without the above, some commands may not work properly, being unable to find data in /proc and /sys in particular.

If you are behind a proxy, copy your files defining your proxy settings (typically /etc/environment) under the same path /mnt/rootfs.

Also copy your name resolution settings to the rootfs:

sudo cp /etc/resolv.conf /mnt/rootfs/etc/resolv.conf

Modify the rootfs

sudo chroot /mnt/rootfs/

If you are using a special package source, you can add it to /etc/apt/sources.list

Now, update your package list and install extra packages. For example:

apt-get update
apt-get install openssh-server

Once you are done, exit the chroot:



sudo rm /mnt/rootfs/etc/resolv.conf

You may also undo your proxy setting changes (typically /etc/environment).

Then, unmount the filesystems replicated in the chroot:

for f in /var/lock /var/run /dev/shm /dev/pts /dev /sys /proc
  sudo umount /mnt/rootfs/$f

You are done!

Personal tools