commit: fde1bbc5713a5edcb5974926441f6bdf559e0a20
parent 6bf53927de2caae8adc7defc82f92da01bf2576c
Author: Dor Askayo <dor.askayo@gmail.com>
Date: Sun, 6 Mar 2022 14:07:03 +0200
Update bootstrap.cfg immediately after interactive prompts
This improves the readablility of the scripts. It also helps avoid
cases where a variable could be set twice in bootstrap.cfg, such as
the DISK variable.
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sysa/run.sh b/sysa/run.sh
@@ -71,6 +71,8 @@ if [ -z "${CHROOT}" ]; then
echo "or not. Is it? (yes/no answer)"
ask_chroot
echo
+
+ echo "export CHROOT=${CHROOT}" >> "${SOURCES}/bootstrap.cfg"
fi
ask_timestamps() {
@@ -91,15 +93,13 @@ if [ -z "${FORCE_TIMESTAMPS}" ]; then
echo "fully reproducible disk image. (yes/no answer)"
ask_timestamps
echo
+
+ echo "export FORCE_TIMESTAMPS=${FORCE_TIMESTAMPS}" >> "${SOURCES}/bootstrap.cfg"
fi
echo "Thank you! All done."
-# Write to bootstrap.cfg
-rm "${SOURCES}/bootstrap.cfg"
-for var in CHROOT FORCE_TIMESTAMPS DISK ARCH UPDATE_CHECKSUMS; do
- echo "export ${var}=${!var}" >> "${SOURCES}/bootstrap.cfg"
-done
+echo "export ARCH=${ARCH}" >> "${SOURCES}/bootstrap.cfg"
mkdir -p "${DESTDIR}" "${REPO}" /dev
diff --git a/sysb/run.sh b/sysb/run.sh
@@ -53,14 +53,14 @@ ask_disk() {
if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then
echo "You did not provide a valid disk in the configuration file."
ask_disk
+
+ echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
fi
PREFIX=/usr
SOURCES="${PREFIX}/src"
SYSC=/sysc
-echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
-
# Otherwise, add stuff from sysa to sysb
echo "Mounting sysc"
mkdir /sysc