Skip to content

Instantly share code, notes, and snippets.

@hh
Created June 23, 2012 14:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hh/2978542 to your computer and use it in GitHub Desktop.
Save hh/2978542 to your computer and use it in GitHub Desktop.
Try to create a simple precise iso using live-build
LB_DIR=$(mktemp -d -p /run/shm precisely.XXXX)
cd $LB_DIR
apt-get install -y livecd-rootfs
lb config \
--mode ubuntu \
--architecture amd64 \
--distribution precise \
--archive-areas "main universe multiverse" \
--parent-distribution precise \
--parent-archive-areas "main universe multiverse" \
--apt-options "--yes --force-yes" # \
# use the following to speed things up with a local mirror
# --mirror-binary http://localhost:8910/ubuntu/ \
# --mirror-bootstrap http://localhost:8910/ubuntu/ \
# --parent-mirror-bootstrap http://localhost:8910/ubuntu/ \
# --parent-mirror-chroot http://localhost:8910/ubuntu/ \
# --parent-mirror-chroot-volatile http://localhost:8910/ubuntu/ \
# --parent-mirror-chroot-security http://localhost:8910/ubuntu-security/ \
# --parent-mirror-binary http://localhost:8910/ubuntu/ \
# --parent-mirror-binary-security http://localhost:8910/ubuntu-security/
mkdir -p config/binary_local-hooks
QUICKFIX=config/binary_local-hooks/copy_bootfiles_into_expected_places.sh
cat <<EOF> $QUICKFIX
#!/bin/sh
set -e
if [ ! -e binary/casper/vmlinuz ]
then
# copy the one kernel into it's expected place
mv binary/casper/vmlinuz* binary/casper/vmlinuz
# the config is looking for an lzma compressed initrd
zcat binary/casper/initrd.img* | lzma -c --best > binary/casper/initrd.lz
# remove the old one
rm binary/casper/initrd.img*
fi
EOF
# cdrom/preseed/ubuntu.seed
# pwconv: failed to change the mode of /etc/passwd- to 0600
# Waiting for network configuration
sudo lb build
echo "Please test with 'kvm -m 2048 -cdrom $LB_DIR/*iso'"
echo "If you can make a working iso, please comment on https://gist.github.com/2978542"
echo "and/or https://answers.launchpad.net/ubuntu/+source/live-build/+question/200206"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment