From 277f0cec71b8a9a1b109225a69551ef5c7ba05e2 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 10 Apr 2018 18:43:43 +0100 Subject: 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. --- scripts/build/chroot_preseed | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- cgit v1.2.3