summaryrefslogtreecommitdiffstats
path: root/share/scripts/debconf
diff options
context:
space:
mode:
Diffstat (limited to 'share/scripts/debconf')
-rwxr-xr-xshare/scripts/debconf32
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"