From 9f1f3716d6d935dca7f3c9934acc3229ba676111 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 16 Jan 2012 12:53:03 +0000 Subject: [PATCH] Get live-build to divert update-initramfs while building the chroot. This should cut a few minutes off builds, particularly on slow architectures. --- debian/changelog | 8 +++++++- live-build/auto/build | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7d0ee085..490348df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,13 @@ -livecd-rootfs (2.49) UNRELEASE; urgency=low +livecd-rootfs (2.49) UNRELEASED; urgency=low + [ Adam Conrad ] * Update maintainer to Ubuntu Developers, LaMont doesn't upload much. + [ Colin Watson ] + * Get live-build to divert update-initramfs while building the chroot. + This should cut a few minutes off builds, particularly on slow + architectures. + -- Adam Conrad Thu, 12 Jan 2012 07:27:16 -0700 livecd-rootfs (2.48) precise; urgency=low diff --git a/live-build/auto/build b/live-build/auto/build index a7ccd842..448de7da 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -26,6 +26,27 @@ Expire-Date: 0 fi lb bootstrap "$@" + + Chroot chroot "dpkg-divert --quiet --add \ + --divert /usr/sbin/update-initramfs.REAL --rename \ + /usr/sbin/update-initramfs" + cat > chroot/usr/sbin/update-initramfs <<'EOF' +#! /bin/sh +if [ $# != 1 ] || [ "$1" != -u ]; then + exec update-initramfs.REAL "$@" +fi +echo "update-initramfs: diverted by livecd-rootfs (will be called later)" >&2 +exit 0 +EOF + chmod +x chroot/usr/sbin/update-initramfs + + cat > config/chroot_local-hooks/zz-undivert-update-initramfs.sh <<'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 "$@" if [ -d chroot/var/lib/preinstalled-pool ]; then