Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 9269536

| 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...
  • Loading branch information...
commit a46f7857979dd053ce46b710e1f396d8abb93af8 1 parent 9e1c043
@mika mika authored
Showing with 6 additions and 11 deletions.
  1. +6 −11 grml-live
View
17 grml-live
@@ -618,12 +618,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
@@ -653,10 +647,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 \
@@ -664,7 +654,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
Please sign in to comment.
Something went wrong with that request. Please try again.