From 51ab45ba631ec4065bea9b260dc43653c4159c86 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 22 Aug 2012 13:23:46 +0100 Subject: [PATCH] * Adjust for live-build interface changes up to 3.0~a57-1ubuntu1. * Break ubuntu-defaults-builder (<< 0.31) to account for these interface changes. --- debian/changelog | 8 ++++ debian/control | 3 +- live-build/auto/build | 19 ++++++-- live-build/auto/config | 101 ++++++++++++++++++++++++++--------------- 4 files changed, 88 insertions(+), 43 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d30977c..f72d1b1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.75) UNRELEASED; urgency=low + + * Adjust for live-build interface changes up to 3.0~a57-1ubuntu1. + * Break ubuntu-defaults-builder (<< 0.31) to account for these interface + changes. + + -- Colin Watson Wed, 22 Aug 2012 13:17:47 +0100 + livecd-rootfs (2.74) quantal; urgency=low * Change mksquashfs compression flags for LTSP images, turning diff --git a/debian/control b/debian/control index 5fd67cca..758330c5 100644 --- a/debian/control +++ b/debian/control @@ -8,8 +8,9 @@ Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk Package: livecd-rootfs Architecture: all -Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a22-1ubuntu1) +Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a55-1) Suggests: partimage +Breaks: ubuntu-defaults-builder (<< 0.31) Description: construction script for the livecd rootfs livecd-rootfs provides the script used to create the root filesystem on the livecd. diff --git a/live-build/auto/build b/live-build/auto/build index e6c98121..d57d81ba 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -1,16 +1,16 @@ -#! /bin/bash +#! /bin/sh set -e -set -o pipefail export LC_ALL=C -. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh +( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh Arguments "${@}" Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults +rm -f binary.success ( if [ -d config/gnupg ]; then cat << @@EOF > config/gnupg/NEWKEY @@ -41,12 +41,11 @@ exit 0 EOF chmod +x chroot/usr/sbin/update-initramfs - cat > config/chroot_local-hooks/zz-undivert-update-initramfs.sh <<'EOF' + cat > config/hooks/999-undivert-update-initramfs.chroot <<'EOF' #! /bin/sh rm -f /usr/sbin/update-initramfs dpkg-divert --quiet --remove --rename /usr/sbin/update-initramfs EOF - chmod +x config/chroot_local-hooks/zz-undivert-update-initramfs.sh lb chroot "$@" @@ -256,8 +255,18 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS fi lb binary "$@" + touch binary.success ) 2>&1 | tee binary.log +# bash has trouble with the build.sh sourcing arrangement at the top of this +# file, so we use this cheap-and-cheerful approach rather than the more +# correct 'set -o pipefail'. +if [ -e binary.success ]; then + rm -f binary.success +else + exit 1 +fi + # Link output files somewhere BuildLiveCD will be able to find them. PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" diff --git a/live-build/auto/config b/live-build/auto/config index fc963d5a..041bed3d 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -31,7 +31,7 @@ if [ -z "$MIRROR" ]; then esac fi -mkdir -p config/task-lists config/package-lists +mkdir -p config/package-lists add_task () { @@ -40,7 +40,7 @@ add_task () local task for task; do - echo "$task" >> "config/task-lists/livecd-rootfs.chroot_$pass.list" + echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" done } @@ -51,7 +51,7 @@ add_package () local pkg for pkg; do - echo "$pkg" >> "config/package-lists/livecd-rootfs.chroot_$pass.list" + echo "$pkg" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" done } @@ -67,6 +67,19 @@ PREINSTALLED=false PREINSTALL_POOL= PREINSTALL_POOL_SEEDS= +CHROOT_HOOKS= +BINARY_HOOKS= + +add_chroot_hook () +{ + CHROOT_HOOKS="${CHROOT_HOOKS:+$CHROOT_HOOKS }$1" +} + +add_binary_hook () +{ + BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1" +} + case $IMAGEFORMAT in ext2|ext3|ext4) OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT" @@ -135,12 +148,14 @@ case $PROJECT in add_task install minimal standard kubuntu-desktop LIVE_TASK='kubuntu-live' COMPONENTS='main restricted universe' + add_chroot_hook remove-gnome-icon-cache ;; kubuntu-active) add_task install minimal standard kubuntu-active LIVE_TASK='kubuntu-active-live' COMPONENTS='main restricted universe' + add_chroot_hook remove-gnome-icon-cache ;; edubuntu|edubuntu-dvd) @@ -260,6 +275,37 @@ case $ARCH in ;; esac +add_chroot_hook update-apt-file-cache +add_chroot_hook update-apt-xapian-index +add_chroot_hook update-mlocate-database +add_chroot_hook remove-dbus-machine-id +add_chroot_hook remove-openssh-server-host-keys +add_chroot_hook remove-udev-persistent-rules + +case $PROJECT in + ubuntu-server) + ;; + + *) + add_chroot_hook remove-python-py + ;; +esac + +case $PROJECT in + ubuntu-server) + cat > config/hooks/100-remove-fstab.chroot <> config/chroot +echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary + if $BINARY_REMOVE_LINUX; then cat > config/binary_rootfs/excludes << EOF boot/vmlinu?-* @@ -284,50 +333,27 @@ boot/initrd.img-* EOF fi -if [ "$PROJECT" != ubuntu-server ]; then - ln -s /usr/share/live/build/examples/hooks/all_chroot_pyc-purge.sh config/chroot_local-hooks/ -fi - -case $PROJECT in - kubuntu|kubuntu-active) - ln -s /usr/share/live/build/examples/hooks/kubuntu_chroot_icon-theme.sh config/chroot_local-hooks/ - ;; - - ubuntu-server) - cat > config/chroot_local-hooks/ubuntu-server_chroot_remove-fstab.sh < config/archives/proposed.chroot.list << EOF + cat > config/archives/proposed.list.chroot << EOF deb $LB_PARENT_MIRROR_BINARY_VOLATILE $SUITE-proposed $LB_PARENT_ARCHIVE_AREAS EOF - cp -a config/archives/proposed.chroot.list \ - config/archives/proposed.binary.list + cp -a config/archives/proposed.list.chroot \ + config/archives/proposed.list.binary fi case $PROJECT in *-dvd) . config/bootstrap - cat > config/archives/dvd.binary.list << EOF + cat > config/archives/dvd.list.binary << EOF deb $LB_PARENT_MIRROR_BINARY $SUITE universe multiverse deb $LB_PARENT_MIRROR_BINARY_SECURITY $SUITE-security universe multiverse deb $LB_PARENT_MIRROR_BINARY_VOLATILE $SUITE-updates universe multiverse EOF if [ "$PROPOSED" ]; then - cat >> config/archives/dvd.binary.list << EOF + cat >> config/archives/dvd.list.binary << EOF deb $LB_PARENT_MIRROR_BINARY_VOLATILE $SUITE-proposed universe multiverse EOF fi @@ -412,10 +438,11 @@ if [ "$PREINSTALLED" = "true" ]; then wget $MIRROR/indices/override.$SUITE.extra.$component \ ) done - PREINSTALL_POOL_HOOK=config/chroot_local-hooks/preinstall-pool.sh - echo "#! /bin/sh" > $PREINSTALL_POOL_HOOK - echo "mkdir -p /var/lib/preinstalled-pool/pool/" >> $PREINSTALL_POOL_HOOK - echo "cd /var/lib/preinstalled-pool/pool/" >> $PREINSTALL_POOL_HOOK - echo "apt-get -y download $PREINSTALL_POOL" >> $PREINSTALL_POOL_HOOK + cat > config/hooks/100-preinstall-pool.chroot <