From 8e9c9cb1f148d1eac5bcea9f5f325a72d219df86 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 20 Nov 2008 14:52:15 +0100 Subject: [PATCH] Always execute finalize(), based on patch by Tong Sun since mounting /proc, etc are unconditional, it make sense for 'finalize' function to be executed each time, without being skipped due to the stage file --- chroot-script | 9 ++++++--- debian/changelog | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/chroot-script b/chroot-script index eaf39f6..b5f1abe 100755 --- a/chroot-script +++ b/chroot-script @@ -36,9 +36,11 @@ stage() { echo "$2" > "$STAGES/$1" return 0 elif grep -q done "$STAGES/$1" 2>/dev/null ; then - echo "[*] Notice: stage $1 has been executed already, skipping execution therefore.">&2 + echo " [*] Notice: stage $1 has been executed already, skipping execution therefore.">&2 return 1 fi + echo " Executing stage ${1}" + return 0 } # }}} @@ -429,12 +431,13 @@ finalize() { # execute the functions {{{ for i in chrootmirror grmlrepos kernelimg_conf makedev install_policy_rcd \ packages extrapackages mkinitrd kernel reconfigure hosts interfaces \ - timezone fstab hostname initrd grub passwords custom_scripts \ - services finalize ; do + timezone fstab hostname initrd grub passwords custom_scripts services ; do if stage $i ; then $i && stage $i done || exit 1 fi done + # always execute the finalize stage: + finalize # }}} # finally exit the chroot {{{ diff --git a/debian/changelog b/debian/changelog index 5c62f61..a67ee07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ grml-debootstrap (0.23) unstable; urgency=low - added "--nodebootstrap": Skip debootstrap, only do configuration to the target - add -v, --verbose: Increase verbosity + - do not create stage file for finalize * Edit /etc/network/interfaces as well if the file exists already, we definitely need at least a loopback interface. * Adjust hostname in /etc/postfix/main.cf. @@ -28,7 +29,7 @@ grml-debootstrap (0.23) unstable; urgency=low the hint, Tong Sun). * Support execution of further scripts via --scripts and --chroot-scripts. - -- Michael Prokop Thu, 20 Nov 2008 14:45:19 +0100 + -- Michael Prokop Thu, 20 Nov 2008 14:49:05 +0100 grml-debootstrap (0.22) unstable; urgency=low -- 2.1.4