diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-06-29 11:29:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-06-29 11:38:54 +0000 |
commit | e07edad5f45907e9c7f4d6c24823b80cbe282316 (patch) | |
tree | eb4049b82fc0765fe2f5d731ef52a3a15cdcd282 /share/scripts | |
parent | Adding upstream version 20210411. (diff) | |
download | open-infrastructure-compute-tools-e07edad5f45907e9c7f4d6c24823b80cbe282316.tar.xz open-infrastructure-compute-tools-e07edad5f45907e9c7f4d6c24823b80cbe282316.zip |
Adding upstream version 20210628.upstream/20210628
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts')
-rwxr-xr-x | share/scripts/debconf | 32 |
1 files changed, 26 insertions, 6 deletions
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" |