From: Christian Hofstaedtler Date: Fri, 25 Nov 2011 12:07:05 +0000 (+0100) Subject: Retain FAI logs in grml_logs directory X-Git-Tag: v0.17.0~70 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=4152229391fd4af0ab4b88408a3efff2e7f52f37;hp=d9a34890461d7b9fc6bd380834f2426c6869ba6e Retain FAI logs in grml_logs directory --- diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index a3e5db8..9df6204 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot +++ b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot @@ -106,7 +106,7 @@ nuke(){ # set all files in the given directories to a length of zero zero(){ - for i in $(find "$@" -type f -size +0 -not -name \*.ini 2>/dev/null); do + for i in $(find "$@" -type f -size +0 -not -name \*.ini -not -path '*/fai/*' 2>/dev/null); do :> "$i" done } diff --git a/grml-live b/grml-live index 6538b99..ca23f83 100755 --- a/grml-live +++ b/grml-live @@ -622,11 +622,15 @@ else eend $? fi + # move fai logs into grml_logs directory + mkdir -p "$OUTPUT"/grml_logs/fai/ + cp -r "$CHROOT_OUTPUT"/var/log/fai/"$HOSTNAME"/last/* "$OUTPUT"/grml_logs/fai/ + chown root:adm "$OUTPUT"/grml_logs/fai/* + chmod 664 "$OUTPUT"/grml_logs/fai/* + rm -rf "$CHROOT_OUTPUT"/var/log/fai + # Remove all FAI logs from chroot if class RELEASE is used: - if [ -f "$CHROOT_OUTPUT"/etc/grml_fai_release ] ; then - rm -rf "$CHROOT_OUTPUT"/var/log/fai/* - rm -f "$CHROOT_OUTPUT"/var/log/install_packages.list - fi + rm -f "$CHROOT_OUTPUT"/var/log/install_packages.list umount_all