From: Michael Prokop Date: Thu, 6 May 2021 22:09:05 +0000 (+0200) Subject: Support setting custom aptoptions for FAI X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=refs%2Fheads%2Fmika%2Ffaiopts Support setting custom aptoptions for FAI /dev/pts might not be available, for for example when running grml-live inside a (unprivileged) docker container. Then apt/aptitude invocations cause the following error message to show up: | E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device) Sadly FAI's task_instsoft include the following hardcoded check: | grep -E "^E:" $LOGDIR/software.log && task_error 472 So whenever the /dev/pts error message shows up, FAI considers this as error and we're failing installation. apt supports usage of `-o Dpkg::Use-Pty=0` though to not trigger the pty related code (pkgDPkgPM::StartPtyMagic()). By setting the environment variable aptoptions="-o Dpkg::Use-Pty=0" for FAI execution, we can avoid this error message showing up in FAI's software.log and being considered as error. Support passing custom environment variables to the fai command line via $FAI_ENV. --- diff --git a/grml-live b/grml-live index 8b0adfe..87995df 100755 --- a/grml-live +++ b/grml-live @@ -756,8 +756,8 @@ else mount --bind "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/" log "Executed FAI command line:" - log "BUILD_ONLY=$BUILD_ONLY BOOTSTRAP_ONLY=$BOOTSTRAP_ONLY GRML_LIVE_CONFIG=$CONFIGDUMP WAYBACK_DATE=$WAYBACK_DATE fai $VERBOSE -C $GRML_FAI_CONFIG -s file:///$GRML_FAI_CONFIG/config -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS" - BUILD_ONLY="$BUILD_ONLY" BOOTSTRAP_ONLY="$BOOTSTRAP_ONLY" GRML_LIVE_CONFIG="$CONFIGDUMP" fai $VERBOSE \ + log "$FAI_ENV BUILD_ONLY=$BUILD_ONLY BOOTSTRAP_ONLY=$BOOTSTRAP_ONLY GRML_LIVE_CONFIG=$CONFIGDUMP WAYBACK_DATE=$WAYBACK_DATE fai $VERBOSE -C $GRML_FAI_CONFIG -s file:///$GRML_FAI_CONFIG/config -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS" + $FAI_ENV BUILD_ONLY="$BUILD_ONLY" BOOTSTRAP_ONLY="$BOOTSTRAP_ONLY" GRML_LIVE_CONFIG="$CONFIGDUMP" fai $VERBOSE \ -C "$GRML_FAI_CONFIG" -s "file:///$GRML_FAI_CONFIG/config" -c"$CLASSES" \ -u "$HOSTNAME" "$FAI_ACTION" "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE RC="$PIPESTATUS" # notice: bash-only