Package: live-build Version: 3.0~a16-1 Severity: normal Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu ubuntu-patch oneiric
In Ubuntu, we have a task called "minimal" which is what debootstrap installs, and our old live filesystem builder passes 'minimal^' as one of the arguments to 'apt-get install'. I'd like to keep doing this after we switch to live-build - it's organisationally useful for us to have this as a task. However, live-build wants to run the minimal hook if you ask it to install the minimal task, which strips out several things that we consider should be installed. In Debian I assume this isn't a problem because there's no task called "minimal", but it would be quite a hassle for us to rename our existing task now. There doesn't seem to be any way to exclude a hook that happens to match a task name, and since hooks get a stripped environment I wasn't able to check LB_MODE in the hook itself either. Would something like the attached patch be agreeable to you, or would you prefer some different approach? Thanks, -- Colin Watson [cjwat...@ubuntu.com]
>From 1274f14611533d72b09c4a52c4ad4daeac765de6 Mon Sep 17 00:00:00 2001 From: Colin Watson <cjwat...@canonical.com> Date: Wed, 18 May 2011 14:37:14 +0100 Subject: [PATCH] Don't run minimal hook for Ubuntu. --- functions/defaults.sh | 6 ++++++ scripts/build/lb_chroot_hooks | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/functions/defaults.sh b/functions/defaults.sh index 2aa677f..8526335 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -575,6 +575,12 @@ Set_defaults () # LB_HOOKS + case "${LB_MODE}" in + ubuntu) + LB_EXCLUDE_HOOKS="${LB_EXCLUDE_HOOKS:-minimal}" + ;; + esac + # Setting interactive shell/X11/Xnest LB_INTERACTIVE="${LB_INTERACTIVE:-false}" diff --git a/scripts/build/lb_chroot_hooks b/scripts/build/lb_chroot_hooks index 3a15956..cb5296f 100755 --- a/scripts/build/lb_chroot_hooks +++ b/scripts/build/lb_chroot_hooks @@ -43,6 +43,12 @@ HOOKS="$(echo ${LB_HOOKS} ${LB_PACKAGE_LISTS} ${LB_TASKS} | sed -e 's| |\n|g' | for HOOK in ${HOOKS} do + case " ${LB_EXCLUDE_HOOKS} " in + *" ${HOOK} "*) + continue + ;; + esac + if [ -f ${LB_BASE:-/usr/share/live/build}/hooks/"${HOOK}" ] then # Copying hook -- 1.7.4.1