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...
else
[ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot"
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
if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then
FAI_ACTION=softupdate
else
mkdir -p "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/"
mount --bind "${OUTPUT}/grml_sources/" "${CHROOT_OUTPUT}/grml-live/sources/"
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 \
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 \
-u "$HOSTNAME" "$FAI_ACTION" "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE
RC="$PIPESTATUS" # notice: bash-only
-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"