From: Michael Prokop Date: Sun, 20 May 2012 10:49:30 +0000 (+0200) Subject: Generate /etc/grml_live_version after FAI execution + drop /etc/dpkg/dpkg.cfg.d/unsaf... X-Git-Tag: v0.19.2~8 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=8cfed16940d096b619bf35dad42cbf1928d58b8a Generate /etc/grml_live_version after FAI execution + drop /etc/dpkg/dpkg.cfg.d/unsafe-io code FAI uses /etc to detect whether a chroot exists or not and will skip debootstrap stage if /etc exists already. This causes serious problems if the user doesn't have a BASEFILE, therefore we can't edit files inside /etc before running FAI. :( As a result: 1) generate /etc/grml_live_version *after* FAI has been executed 2) drop /etc/dpkg/dpkg.cfg.d/unsafe-io related code. As stated in commit 9269536ba7bb7def8664972d153b71d193450595 | Enable --force-unsafe-io for dpkg | | While this might help on resource constrained systems, no performance | impact has been measured during an unscientific test on a well-geared | machine. it does not seem to be that relevant. But even more important: it doesn't work for systems without BASEFILEs because FAI skips the debootstrap stage if /etc exists already, so we can't generate /etc/dpkg/dpkg.cfg.d/unsafe-io *before* running FAI. Unless someone comes up with benchmarks about real performance impacts let's skip adding more fcopy logic... --- diff --git a/grml-live b/grml-live index 9f5085b..f620b9f 100755 --- a/grml-live +++ b/grml-live @@ -627,12 +627,6 @@ if [ -n "$BUILD_DIRTY" ]; then else [ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot" - # provide inform fai about the ISO we build - [ -d "$CHROOT_OUTPUT/etc/" ] || mkdir -p "$CHROOT_OUTPUT/etc/" - echo '# This file has been generated by grml-live.' > "$CHROOT_OUTPUT/etc/grml_live_version" - [ -n "$GRML_LIVE_VERSION" ] && echo "GRML_LIVE_VERSION=$GRML_LIVE_VERSION" >> "$CHROOT_OUTPUT/etc/grml_live_version" - [ -n "$SUITE" ] && echo "SUITE=$SUITE" >> "$CHROOT_OUTPUT/etc/grml_live_version" - if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then FAI_ACTION=softupdate else @@ -662,10 +656,6 @@ else mkdir -p "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/" mount --bind "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/" - # tell dpkg to use "unsafe io" during the build - [ -d "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d" ] || mkdir -p "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d" - echo force-unsafe-io > "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d/unsafe-io" - log "Executed FAI command line:" log "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" BUILD_ONLY="$BUILD_ONLY" BOOTSTRAP_ONLY="$BOOTSTRAP_ONLY" GRML_LIVE_CONFIG="$CONFIGDUMP" fai $VERBOSE \ @@ -673,7 +663,12 @@ else -u "$HOSTNAME" "$FAI_ACTION" "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE RC="$PIPESTATUS" # notice: bash-only - rm -f "$CHROOT_OUTPUT/etc/dpkg/dpkg.cfg.d/unsafe-io" + # 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) :( + echo '# This file has been generated by grml-live.' > "$CHROOT_OUTPUT/etc/grml_live_version" + [ -n "$GRML_LIVE_VERSION" ] && echo "GRML_LIVE_VERSION=$GRML_LIVE_VERSION" >> "$CHROOT_OUTPUT/etc/grml_live_version" + [ -n "$SUITE" ] && echo "SUITE=$SUITE" >> "$CHROOT_OUTPUT/etc/grml_live_version" FORCE_ISO_REBUILD=true