summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2018-04-10 18:43:43 +0100
committerLuca Boccassi <bluca@debian.org>2018-04-10 21:58:00 +0100
commit277f0cec71b8a9a1b109225a69551ef5c7ba05e2 (patch)
tree482f2e06204816a5f65ae382c415b1b38eea5333
parentda0119396559308b29c78a7cc983013cf07797f0 (diff)
downloadvyos-live-build-277f0cec71b8a9a1b109225a69551ef5c7ba05e2.tar.gz
vyos-live-build-277f0cec71b8a9a1b109225a69551ef5c7ba05e2.zip
Reconfigure bootstrapped packages after preseeding.
live-build supports preseeding configuration, but the configuration has to be installed after bootstrapping since it needs the debconf tools to be applied. But packages that have already been installed and configured in the bootstrap step will then ignore those preseeded configs. After applying each preseed file, parse the package list and manually reconfigure the relevant package(s) so that the configuration will be applied.
-rwxr-xr-xscripts/build/chroot_preseed15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/build/chroot_preseed b/scripts/build/chroot_preseed
index ab04df054..028daa889 100755
--- a/scripts/build/chroot_preseed
+++ b/scripts/build/chroot_preseed
@@ -59,6 +59,21 @@ then
# Removing local preseed file
rm -f chroot/root/preseed
+
+ # After preseeding debconf, reconfigure packages that have already
+ # been installed in the debootstrap phase.
+ # Strip comments and empty lines and take first column (pkg name).
+ sed -e 's/[[:space:]]*#.*//' -e '/^[[:space:]]*$/d' \
+ -e 's/[[:space:]].*//g' "${PRESEED}" | \
+ while read PKG
+ do
+ # Don't know the filename, but we want to query only dpkg
+ Check_installed chroot "placeholder" "${PKG}"
+ if [ ${INSTALL_STATUS} -eq 0 ]
+ then
+ Chroot chroot "dpkg-reconfigure ${PKG}"
+ fi
+ done
fi
done