From: Michael Prokop Date: Thu, 13 Mar 2014 11:14:34 +0000 (+0100) Subject: Move return code check of FAI-run before wrinting to /etc of live system X-Git-Tag: v0.23.0~3 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=3ffdf598cbcaa851a122309572a5710d40b770ef 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. --- 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/