From 251870158b34972626130b0f20c53b4ee321849a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 29 Jun 2021 13:39:09 +0200 Subject: Merging upstream version 20210628. Signed-off-by: Daniel Baumann --- share/scripts/debconf | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'share/scripts/debconf') diff --git a/share/scripts/debconf b/share/scripts/debconf index 1994926..9a703e5 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -115,9 +115,14 @@ then exit 1 fi -if [ ! -x /usr/sbin/debootstrap ] +if [ -x /usr/bin/mmdebstrap ] then - echo "'${NAME}': /usr/sbin/debootstrap - no such file." >&2 + BOOTSTRAP="mmdebstrap" +elif [ -x /usr/sbin/debootstrap ] +then + BOOTSTRAP="debootstrap" +else + echo "'${NAME}': /usr/bin/mmdebstrap or /usr/sbin/debootstrap - no such file." >&2 exit 1 fi @@ -390,8 +395,23 @@ Debootstrap () esac mkdir -p "$(dirname ${DIRECTORY})" - debootstrap --verbose --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} \ - --exclude=${EXCLUDE} --include=${INCLUDE} ${PARENT_DISTRIBUTION} "${DIRECTORY}" ${PARENT_MIRROR} + + case "${BOOTSTRAP}" in + debootstrap) + debootstrap --verbose --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} \ + --exclude=${EXCLUDE} --include=${INCLUDE} ${PARENT_DISTRIBUTION} "${DIRECTORY}" ${PARENT_MIRROR} + ;; + + mmdebstrap) + mmdebstrap --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} \ + --mode=root --include=${INCLUDE} ${PARENT_DISTRIBUTION} "${DIRECTORY}" ${PARENT_MIRROR} + ;; + + *) + echo "'${NAME}': ${BOOTSTRAP} - not supported" >&2 + exit 1 + ;; + esac } Configure_apt () @@ -607,7 +627,7 @@ EOF do if grep -qs locales "${FILE}" then - if [ -e "${DIRECTORY}/var/lib/dpkg/info/locales.list" ] + if Chroot "${DIRECTORY}" dpkg --get-selections | awk '{ print $1 }' | grep -qs '^locales$' then rm -f "${DIRECTORY}/etc/default/locale" "${DIRECTORY}/etc/locale.gen" Chroot "${DIRECTORY}" "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=criticial dpkg-reconfigure locales" @@ -650,7 +670,7 @@ EOF fi # Manual hack to regenerate ssh keys - if [ -e "${DIRECTORY}/var/lib/dpkg/info/openssh-server.postinst" ] && \ + if Chroot "${DIRECTORY}" dpkg --get-selections | awk '{ print $1 }' | grep -qs '^openssh-server$' && \ ! ls "${DIRECTORY}"/etc/ssh/ssh_host_*_key > /dev/null 2>&1 then Chroot "${DIRECTORY}" "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=criticial dpkg-reconfigure openssh-server" -- cgit v1.2.3