Introduction

This guide is meant to quickly get you started building your own linaro arm images. Live Build runs natively on arm, pulling packages directly from the appropriate repositories. Builds take time, you'll want plenty of storage and a reasonable net connection. I do this on my Panda, Beagle Board Xm as well as original Beagle so you can too. Questions? [email protected] or seek out tgall_foo on irc.linaro.org or irc.freenode.net.

Live Build

You want the Linaro version of live-build. Other versions will NOT work at this time.

Note that version 2 of live-build was called live-helper. In version 3 it became live-build.

Live Build Setup

  • Either add sudo add-apt-repository ppa:linaro-maintainers/tools

  • sudo apt-get install live-build

or

Live Build Config Part 1

Once you have live-build installed, you'll need a config. You'll want to put this somewhere you have plenty of disk space since your image building will occur there.

There are several configs already available at : http://code.launchpad.net/~linaro-maintainers

  • lp:~linaro-maintainers/linaro/live-helper.config.natty.nano
  • lp:~linaro-maintainers/linaro/live-helper.config.natty.alip
  • lp:~linaro-maintainers/linaro/live-helper.config.natty.developer
  • lp:~linaro-maintainers/linaro/live-helper.config.natty.ubuntu-desktop

If as part of your build, you want to output the results onto an SD as part of the build or create an SD image, you'll need to edit conf_create.sh as found in the main directory of the configs outlined above. Add as appropriate from the following:

  • --lmc-board <board_name> -- name of the board you're working with

  • --lmc-mmc <device_name> -- device that your SD card can be found at. This option means as part of the build, the image is copied DIRECTLY to your sd card.

  • --lmc-hwpack <file_location/file_name> -- path and name of hwpack to be used.

  • --lmc-image-file <file_name> -- image file location/name that you want linaro-media-create to output. specify image-file OR mmc not both. image-file results in a dd-able image.

  • --lmc-image_size -- image size that should be used with image-file.

Example

lb config \
        --archive-areas "main universe" \
        --bootstrap debootstrap \
        --bootstrap-flavour "$bootstrap_flavour" \
        --distribution "$distribution" \
        --mirror-bootstrap "http://ports.ubuntu.com/ubuntu-ports/" \
        --mirror-chroot "http://ports.ubuntu.com/ubuntu-ports/" \
        --mirror-chroot-security "http://ports.ubuntu.com/ubuntu-ports/" \
        --mirror-binary "http://ports.ubuntu.com/ubuntu-ports/" \
        --mirror-binary-security "http://ports.ubuntu.com/ubuntu-ports/" \
        --cache $cache \
        --cache-stages "bootstrap" \
        --initramfs "$initramfs" \
        --mode ubuntu \
        --keyring-packages "$keyring_packages" \
        --linux-flavours "$linux_flavours" \
        --tasks "$tasks" \
        --linux-packages linux \
        --security true \
        --packages "$packages" \
        --chroot-filesystem "none" \
        --binary-images "tar" \
        --binary-filesystem ext3 \
        --username linaro \
        --debian-installer-distribution "$distribution" \        
        --debian-installer-gui false \
        --hostname "$hostname" \
        --net-root-path "/srv/${hostname}-live" \
        --virtual-root-size 1500 \
        --lmc-board panda \
        --lmc-mmc /dev/sdc \
        --lmc-hwpack /home/tgall/Downloads/hwpack_linaro-omap3_20110908-0_armel_supported.tar.gz

More indepth information on linaro-media-create can be found at http://wiki.linaro.org/Source/ImageInstallation

Seeds + Meta Packages

These next two steps, linaro.natty and Linaro-meta are optional.

You may want to modify the collection of packages that are installed as part of the build. This is a two step process.

linaro.natty & platform.natty

First download the seeds

  • bzr branch lp:linaro-seeds linaro.natty

  • bzr branch lp:~linaro-maintainers/linaro-seeds/platform.natty

cd into the linaro.natty directory and edit the seed that you're interested in. Remember that packages without parens ( ) around them are required packages and packages names with ( foomatic-package ) around them are recommended.

Seeds list the named packages you want in your image. Seeds can include other seeds.

You can test your seed with germinate. Best to run from the directory containing linaro.natty.

germinate -S file:///path-to-your-linaro.natty-dir/ -s linaro.natty -m http://ports.ubuntu.com/ubuntu-ports/ -d natty,natty-updates -a armel -c main,universe

If germinate indicates there are no issues, commit your change with bzr commit -m "your commit message about what you added"

Linaro-meta

Now we're going to create the meta package. The meta package is a .deb when installs causes all of the named packages to be installed.

First if you don't have it already obtain the latest linaro-meta package from the linaro-maintainers overlay PPA on launchpad.

Visit http://launchpad.net/~linaro-maintainers/. Click on the Linaro Overlay PPA. Click on view package details link which at the beginning of the package list, right. Click to expand Linaro-meta. Download the .dsc and the tar.gz file for linaro-meta.

untar/compress and then edit update.cfg. Look for the instance of "seed_base:" in the "[natty/bzr]" section. Change this to point to where you linaro.natty directory is located so something like: seed_base: file:///path-to-your-linaro.natty-dir/ then save and exit your editor.

Then run ./update.

Presuming there's no error messages you need to deal with, time to build the meta package.

debuild

Live Build Config Setup Part 2

Ok nearly there.

  • If there are .debs that you need to include in your build (such as the ones might have created in the optional Linaro-meta step) you'll put a copy of them into the chroot_local-packages directory.
  • If you would like to run a script to customize the image in some fashion, you can put that script into chroot_local-hooks. Be careful that any tools you might need will be part of the image install.

Run the conf_create.sh script. (Feel free to look at it ahead of time and potentially change something, most things are fairly obvious) The script will create a config directory. You might want to check config/chroot_local-hooks as well config/chroot_local-packages to make sure they are populated.

Now you're ready.

lb clean --all; lb clean --cache; lb build

That's what you want to run. If the build falls over for some reason after you've fixed whatever it is that went ker-blewey, be sure to do both clean steps.

If the build succeeds, you'll end up with a binary-tar.tar.gz file. This is the file that linaro-media-create uses for image creation. If you didn't add linaro-media-create options as part of your live-build config, now is to use linaro-media-create by hand to create your image for your media. See http://wiki.linaro.org/Source/ImageInstallation


CategoryHowTo

LiveHelper/Hacking (last modified 2011-09-27 15:17:20)