Ubuntu

HOWTO on using live-build to create 12.04 images

Asked by Chris McClimans on 2012-06-12

Regarding the Ubuntu process used to build the 12.04 images available at http://www.ubuntu.com/download

What version of Ubuntu is used? lucid/natty/maverick/oneric/precise?

What versions of live-build, livecd-rootfs, debootstrap (and any other necessary packages) are used?
(include any apt-sources/ppas that aren't in main, restricted, universe or multiverse)

What lb config is used? (Is it just a specific version of livecd-rootfs or is it a particular ppa/bzr branch?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu live-build Edit question
Assignee:
No assignee Edit question
Last query:
2012-06-12
Last reply:
2012-06-23

I'd use Precise, not only is it the latest stable release, it is also LTS.

I'm actually looking for the process used by Canonical to build the official isos, not to create my own distro...
Take a look at the script I'm using now:

#!/bin/bash
# echo out everything to make it easier to understand whats happening while it runs
set -x
# I run this on a 12.04 host, but we are debootstrapping a clean 12.04 in /dev/shm
# to make sure this is exactly the ubuntu release, apt-sources, and package versions we need to create the isos
# host needs debootstrap
apt-get install -y debootstrap
# I have a lot of memory, so I run builds in shm, change these first three lines
mount -o remount,dev /run/shm # by default they mount nodev
export PRECISE_CHROOT=/run/shm/precise-chroot
mkdir -p $PRECISE_CHROOT

# if this gets run twice, don't debootstrap again if /dev exists within the chroot
if [ ! -d $PRECISE_CHROOT/dev ] ; then
    debootstrap --arch amd64 precise $PRECISE_CHROOT http://localhost:8910/ubuntu/ # using local mirror
    mount proc $PRECISE_CHROOT/proc -t proc
    mount sysfs $PRECISE_CHROOT/sys -t sysfs
    cp /etc/hosts $PRECISE_CHROOT/etc/hosts
fi

# if this gets run twice, don't install livecd-rootfs (depends on live-build in precise)
if [ ! -f $PRECISE_CHROOT/usr/bin/lb ] ; then
    chroot $PRECISE_CHROOT /usr/bin/apt-get install -y livecd-rootfs
fi

# create a live-build area within our new precise-chroot
export LIVE_BUILD=$PRECISE_CHROOT/lb
mkdir -p $LIVE_BUILD/{config,config/chroot_local-packageslist,config/chroot_sources}

# copying in the livecd-rootfs/live-build auto _seems_ like the right thing to do
# but it's more cargo culting than anything... can I get some direction here?
cp -a $PRECISE_CHROOT/usr/share/livecd-rootfs/live-build/auto $LIVE_BUILD/auto

# generates ./config/* based on the auto config from livecd-rootfs
chroot $PRECISE_CHROOT bash -c 'cd lb ; PROJECT=ubuntu \
 SUITE=precise \
 ARCH=amd64 \
 BINARYFORMAT=iso \
 LB_PARENT_MIRROR_BOOTSTRAP="http://localhost:8910/ubuntu" \
 LB_PARENT_MIRROR_CHROOT="http://localhost:8910/ubuntu" \
 LB_PARENT_MIRROR_CHROOT_VOLATILE="http://localhost:8910/ubuntu" \
 LB_PARENT_MIRROR_CHROOT_SECURITY="http://localhost:8910/ubuntu-security" \
 LB_PARENT_MIRROR_UBUNTU_INSTALLER="http://localhost:8910/ubuntu" \
 LB_MIRROR_BOOTSTRAP="http://localhost:8910/ubuntu" \
 LB_MIRROR_CHROOT="http://localhost:8910/ubuntu" lb config'

chroot $PRECISE_CHROOT bash -c 'cd lb ; lb build'

Colin Watson (cjwatson) said : #6

We used livecd-rootfs on precise, which contains live-build configuration in live-build/, driven from the BuildLiveCD script. That's configured to only build the squashfs parts; the ISO images were built using https://code.launchpad.net/+branch/ubuntu-cdimage and https://code.launchpad.net/~ubuntu-cdimage/debian-cd/ubuntu.

Hippie Hacker (hippiehacker) said : #7

Thanks Colin, I looked at those two repos but wasn't able to get BuildLiveCD to work.

https://gist.github.com/2978542 is another attempt to just use live-build, but it seems a dead end.

Could you give a bit of direction to the use/config of the live-build + BuildLiveCD using the ubuntu-cdimage and debian-cd/ubuntu repos? I wasn't able to cobble it together on my own.

Can you help with this problem?

Provide an answer of your own, or ask Chris McClimans for more information if necessary.

To post a message you must log in.