X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=525011dead9837211fc85c6e56a4301534380c96;hp=27e8e6ae04c1f6f553f9f862a96de9ea4b3abe1f;hb=9fa2e911f44167323dc21b865168e45527c071ec;hpb=a49d9355f0de16c7e14b789839101598983c451b diff --git a/grml-live b/grml-live index 27e8e6a..525011d 100755 --- a/grml-live +++ b/grml-live @@ -120,6 +120,8 @@ BUILD_ONLY='' BUILD_DIRTY='' BOOTSTRAP_ONLY='' HOSTNAME='' +USERNAME='' +CONFIGDUMP='' # don't use colors/escape sequences if [ -r /lib/lsb/init-functions ] ; then @@ -165,6 +167,7 @@ umount_all() { bailout() { rm -f /var/run/fai/fai_softupdate_is_running \ /var/run/fai/FAI_INSTALLATION_IN_PROGRESS + [ -n "$CONFIGDUMP" ] && rm -f "$CONFIGDUMP" [ -n "$SQUASHFS_STDERR" ] && rm -rf "$SQUASHFS_STDERR" umount_all [ -n "$1" ] && EXIT="$1" || EXIT="1" @@ -517,6 +520,13 @@ log "$CMDLINE" einfo "Logging actions to logfile $LOGFILE" # }}} +# dump config variables into file, for script access {{{ +CONFIGDUMP=$(mktemp) +set | egrep \ + '^(GRML_NAME|RELEASENAME|DATE|VERSION|SUITE|ARCH|DISTRI_NAME|USERNAME|HOSTNAME|APT_PROXY)=' \ + > ${CONFIGDUMP} +# }}} + # unpack chroot {{{ if [ -n "${UNPACK_CHROOT}" ]; then log "Unpacking chroot from ${UNPACK_CHROOT}" @@ -631,8 +641,8 @@ else 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_LOCAL_CONFIG=$LOCAL_CONFIG 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_LOCAL_CONFIG="$LOCAL_CONFIG" fai $VERBOSE \ + 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 \ -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 @@ -645,24 +655,6 @@ else 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 - else - einfo "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$DATE]" - log "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$DATE]" - echo "$GRML_NAME $VERSION Release Codename $RELEASENAME [$DATE]" > $CHROOT_OUTPUT/etc/grml_version - chmod 644 $CHROOT_OUTPUT/etc/grml_version - einfo "Rebuilding initramfs" - # make sure new /etc/grml_version reaches initramfs, iterate over all - # present kernel versions (note: we can't really handle more than one - # kernel version anyway right now) - # chroot $CHROOT_OUTPUT update-initramfs -u -t => might break when using kernel-package :( - for initrd in "$(basename $CHROOT_OUTPUT/boot/vmlinuz-*)" ; do - if ! chroot $CHROOT_OUTPUT update-initramfs -k "${initrd##vmlinuz-}" -c ; then - einfo "Creating fresh initrd did not work, trying update instead:" - log "Creating fresh initrd did not work, trying update instead:" - chroot $CHROOT_OUTPUT update-initramfs -k "${initrd##vmlinuz-}" -u - fi - done - eend $? fi # move fai logs into grml_logs directory