ImageCreation

How To Make an Image

Background

This wiki page explains how to make an image for the Ubuntu MID and Ubuntu Mobile projects using the livecd-rootfs tool, and a secondary script to assemble the pieces. Previous to the Intrepid release, Ubuntu Mobile utilised moblin-image-creator, which isn't a supported way to build images for Intrepid and onwards.

An image is made up of a squashfs filesystem, which contains an install of either Ubuntu MID or Ubuntu Mobile, a kernel, initramfs and a syslinux install.

Procedure

1. First, we need to make the squashfs that will live inside the image. Install the livecd-rootfs package if you haven't already, and run the following command:

sudo livecd.sh -d intrepid ubuntu-mid

A note that livecd-rootfs requires the privledges to chroot() and bind mount things like /proc, so needs to run as root. livecd-rootfs requires debootstrap to know how to install the base system for a particular release, so if you are running Hardy, you will require the backported debootstrap from Intrepid.

livecd-rootfs can take many options including using a local mirror (using the -m option), and setting the architecture to build for (using -a)

2. Now that we have the squashfs built in livecd.ubuntu-mid.squashfs, we need to create a VFAT filesystem and place the pieces in the right spot.

The create-image.sh script can be checked out of the mobile-scripts bzr branch, found at http://bazaar.launchpad.net/%7Eubuntu-mobile-dev/ubuntu-mobile/mobile-scripts/, which also contains useful scripts for changing built images, such as edit_image.

This script, using dosfstools, mtools and syslinux (available in the dosfstools, mtools and syslinux packages respectively), is able to be told on the command line what type of image it is building, and will construct the needed directories that the image requires.

A second optional argument will specify the amount of "overfill" space to create in the image -- by default this is 20MB, which should be enough for the kernel and initramfs, but if you are looking to expand the image by installing optional software, you'll want to increase it to 50 or 100MB.

MobileTeam/Mobile/HowTo/ImageCreation (last edited 2008-10-24 00:17:14 by 14)