set -u
set -e
+. "$GRML_LIVE_CONFIG"
# visualize chroot inside zsh:
echo grml_chroot > $target/etc/debian_chroot
-HOSTNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$HOSTNAME" ] || HOSTNAME=grml
echo "$HOSTNAME" > $target/etc/hostname
if [ -n "${APT_PROXY:-}" ] ; then
set -u
set -e
-HOSTNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$HOSTNAME" ] || HOSTNAME=grml
+. "$GRML_LIVE_CONFIG"
# the hostname of the chroot usually isn't the same as the one for the live-system
BUILD_HOSTNAME="$($ROOTCMD hostname)"
set -u
set -e
-
-USERNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$USERNAME" ] || USERNAME=grml
+. "$GRML_LIVE_CONFIG"
if ! [ -r $target/etc/runlevel.conf ] ; then
echo 'Warning: /etc/runlevel.conf does not exist...'
set -u
set -e
-
-USERNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$USERNAME" ] || USERNAME=grml
+. "$GRML_LIVE_CONFIG"
fcopy -v /etc/sudoers
sed -i "s/\$USERNAME/$USERNAME/" $target/etc/sudoers
set -u
set -e
-
-USERNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$USERNAME" ] || USERNAME=grml
+. "$GRML_LIVE_CONFIG"
if grep -q "$USERNAME:x:1000" $target/etc/group ; then
echo "group $USERNAME exists already, skipping"
set -u
set -e
-
-USERNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$USERNAME" ] || USERNAME=grml
+. "$GRML_LIVE_CONFIG"
fcopy -v /etc/fstab
sed -i "s/uid=USERNAME,gid=USERNAME/uid=$USERNAME,gid=$USERNAME/" $target/etc/fstab
set -u
set -e
-
-HOSTNAME=''
-[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
-[ -n "$GRML_LIVE_LOCAL_CONFIG" ] && . "$GRML_LIVE_LOCAL_CONFIG"
-[ -n "$HOSTNAME" ] || HOSTNAME=grml
+. "$GRML_LIVE_CONFIG"
fcopy -v /etc/hosts
BUILD_DIRTY=''
BOOTSTRAP_ONLY=''
HOSTNAME=''
+CONFIGDUMP=''
# don't use colors/escape sequences
if [ -r /lib/lsb/init-functions ] ; then
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"
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}"
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