From 80c59a14fa45f51df124500a0e38a7c300f30e2b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 23 Aug 2012 10:56:35 +0100 Subject: [PATCH] Attempt to restrict task installation to the native architecture. --- debian/changelog | 1 + live-build/auto/config | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b97ff488..fbe70b78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ livecd-rootfs (2.76) UNRELEASED; urgency=low - Fix installation of ubuntu-server fstab removal hook. - Pass --architectures to 'lb config', to make it easier to build images for a different architecture. + - Attempt to restrict task installation to the native architecture. -- Colin Watson Thu, 23 Aug 2012 09:43:38 +0100 diff --git a/live-build/auto/config b/live-build/auto/config index 7d3a83a2..207f48b8 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -39,8 +39,26 @@ add_task () shift local task + # The removal of direct task installation support from live-build + # poses some problems. If the chroot has multiarch configured - for + # example, if we're building for amd64 - then dumpavail will show + # foreign-architecture packages which will have their own Task + # lines, but which we don't want to install. (Compare + # PackageContainerInterface::FromTask in apt, which restricts task + # expansion to the native architecture.) We therefore restrict our + # search to stanzas with Architecture: $ARCH or all. + # + # However, even this may not be accurate enough. At the moment I + # have no idea what happens if an Architecture: all package has + # different Task fields on different architectures. This is + # probably a lurking timebomb that we need to fix. In the meantime, + # the Architecture restriction at least saves us from abject + # failure. + for task; do - echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" + # We need a ridiculous number of backslashes to protect + # parentheses from eval. + echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" done }