From: Michael Prokop Date: Wed, 19 Sep 2007 15:18:18 +0000 (+0200) Subject: Bugfix for REMOVE_DOCS class; implement log-check X-Git-Tag: 0.0.1~6 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=f684e9577f54be351e2c3dcdbc4414101433bb10 Bugfix for REMOVE_DOCS class; implement log-check --- diff --git a/docs/grml-live.txt b/docs/grml-live.txt index 7a68af8..0b21b58 100644 --- a/docs/grml-live.txt +++ b/docs/grml-live.txt @@ -380,10 +380,6 @@ a mail: Known TODOs ----------- -* "fai dirinstall" does not seem to always exit according to what happend during -the build; make sure to exit on any error (check logs for stuff like "dpkg: -error processing" [software.log], "FAILED with exit code" [shell.log],...) - * support something like a directory /etc/grml/fai/packages to install additional Debian packages without the need for a Debian repository diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index 88345d5..9af8da1 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot +++ b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot @@ -24,7 +24,7 @@ if ! ifclass NO_ONLINE ; then fi # remove /usr/share/doc, /usr/share/info,... only in class REMOVE_DOCS: -if ifclass REMOVE_DOCS: ; then +if ifclass REMOVE_DOCS ; then cp /etc/grml/fai/grml/grml_cleanup_chroot.remove_docs $target/root/ $ROOTCMD /root/grml_cleanup_chroot.remove_docs rm $target/root/grml_cleanup_chroot.remove_docs diff --git a/grml-live b/grml-live index 956f8b4..8ff93f9 100755 --- a/grml-live +++ b/grml-live @@ -176,12 +176,13 @@ else umount $CHROOT_TARGET/sys 2>/dev/null || /bin/true [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}" # notice: 'fai dirinstall' does not seem to exit appropriate -> - # we need better error handling - if [ -r "$CHROOT_TARGET"/etc/grml_cd ] ; then - echo " [*] Finished execution of stage 'fai dirinstall'" - else + if grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log || \ + grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log ; then echo " [!] There was an error during execution of stage 'fai dirinstall'" + echo " Check out /var/log/fai/dirinstall/$HOSTNAME/... for details" exit 1 + else + echo " [*] Finished execution of stage 'fai dirinstall'" fi fi # }}}