diff options
author | Luca Boccassi <bluca@debian.org> | 2018-04-10 18:43:43 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2018-04-10 21:58:00 +0100 |
commit | 277f0cec71b8a9a1b109225a69551ef5c7ba05e2 (patch) | |
tree | 482f2e06204816a5f65ae382c415b1b38eea5333 | |
parent | da0119396559308b29c78a7cc983013cf07797f0 (diff) | |
download | vyos-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-x | scripts/build/chroot_preseed | 15 |
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 |