From 3ffdf598cbcaa851a122309572a5710d40b770ef Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 13 Mar 2014 12:14:34 +0100 Subject: [PATCH] Move return code check of FAI-run before wrinting to /etc of live system If the underlying file system is mounted without suid or dev permissions we otherwise try to write to the live system even though FAI run failed to execute. --- grml-live | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/grml-live b/grml-live index 5ef31a1..1f9b37d 100755 --- a/grml-live +++ b/grml-live @@ -696,6 +696,12 @@ else -u "$HOSTNAME" "$FAI_ACTION" "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE RC="$PIPESTATUS" # notice: bash-only + if [ "$RC" != 0 ] ; then + log "Error: critical error while executing fai [exit code ${RC}]. Exiting." + eerror "Error: critical error while executing fai [exit code ${RC}]. Exiting." ; eend 1 + bailout 1 + fi + # provide inform fai about the ISO we build, needs to be provided # *after* FAI stage, otherwise FAI skips the debootstrap stage if # there is not BASEFILE (as it checks for presence of /etc) :( @@ -705,12 +711,6 @@ else FORCE_ISO_REBUILD=true - if [ "$RC" != 0 ] ; then - log "Error: critical error while executing fai [exit code ${RC}]. Exiting." - eerror "Error: critical error while executing fai [exit code ${RC}]. Exiting." ; eend 1 - bailout 1 - fi - # move fai logs into grml_logs directory mkdir -p "$LOG_OUTPUT"/fai/ cp -r "$CHROOT_OUTPUT"/var/log/fai/"$HOSTNAME"/last/* "$LOG_OUTPUT"/fai/ -- 2.1.4