Created
June 23, 2012 14:46
-
-
Save hh/2978542 to your computer and use it in GitHub Desktop.
Try to create a simple precise iso using live-build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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