Skip to content

Commit

Permalink
Merge pull request #280 from grml/zeha/noenvconfig
Browse files Browse the repository at this point in the history
grml-live: stop passing env vars to fai, make fai overridable
  • Loading branch information
zeha authored Jan 6, 2025
2 parents 0af38fd + 30b547a commit d53ebd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions config/hooks/instsoft.GRMLBASE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
set -u
set -e

# shellcheck source=/dev/null
. "$GRML_LIVE_CONFIG"

# FAI sets ${target}, but shellcheck does not know that.
target=${target:?}

Expand Down
1 change: 1 addition & 0 deletions config/hooks/updatebase.GRMLBASE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

set -u
set -e

# shellcheck source=/dev/null
. "$GRML_LIVE_CONFIG"

Expand Down
3 changes: 3 additions & 0 deletions config/scripts/GRMLBASE/45-grub-images
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
set -e
set -u

# shellcheck source=/dev/null
. "$GRML_LIVE_CONFIG"

# FAI sets $target, but shellcheck does not know that.
target=${target:?}

Expand Down
9 changes: 5 additions & 4 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ HOSTNAME=''
USERNAME=''
CONFIGDUMP=''
FAI_CONF_DIR=''
FAI_PROGRAM='fai'

# don't use colors/escape sequences
if [ -r /lib/lsb/init-functions ] ; then
Expand Down Expand Up @@ -613,10 +614,10 @@ log "$CMDLINE"
einfo "Logging actions to logfile $LOGFILE"
# }}}

# dump config variables into file, for script access {{{
# dump config variables into file, for hooks/scripts access {{{
CONFIGDUMP=$(mktemp)
set | grep -E \
'^(GRML_NAME|RELEASENAME|DATE|VERSION|SUITE|ARCH|DISTRI_NAME|TEMPLATE_DIRECTORY|USERNAME|HOSTNAME|APT_PROXY)=' \
'^(GRML_NAME|RELEASENAME|DATE|VERSION|SUITE|ARCH|DISTRI_NAME|TEMPLATE_DIRECTORY|USERNAME|HOSTNAME|APT_PROXY|BUILD_ONLY|BOOTSTRAP_ONLY|WAYBACK_DATE)=' \
> "${CONFIGDUMP}"
# }}}

Expand Down Expand Up @@ -775,9 +776,9 @@ else
mv "${OUTPUT}"/grml_sources "${CHROOT_OUTPUT}"/grml-live/

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 $FAI_CONF_DIR -s file:///$GRML_FAI_CONFIG -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS"
log "GRML_LIVE_CONFIG=$CONFIGDUMP $FAI_PROGRAM $VERBOSE -C $FAI_CONF_DIR -s file:///$GRML_FAI_CONFIG -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS"
# shellcheck disable=SC2086 # $FAI_ARGS needs splitting
BUILD_ONLY="$BUILD_ONLY" BOOTSTRAP_ONLY="$BOOTSTRAP_ONLY" GRML_LIVE_CONFIG="$CONFIGDUMP" fai $VERBOSE \
GRML_LIVE_CONFIG="$CONFIGDUMP" "$FAI_PROGRAM" $VERBOSE \
-C "$FAI_CONF_DIR" -s "file:///$GRML_FAI_CONFIG" -c"$CLASSES" \
-u "$HOSTNAME" "$FAI_ACTION" "$CHROOT_OUTPUT" $FAI_ARGS | tee -a "$LOGFILE"
RC="${PIPESTATUS[0]}" # notice: bash-only
Expand Down

0 comments on commit d53ebd6

Please sign in to comment.