summaryrefslogtreecommitdiffstats
path: root/share/scripts/debconf
diff options
context:
space:
mode:
authorKatharina Drexel <katharina.drexel@bfh.ch>2021-04-01 07:31:29 +0000
committerKatharina Drexel <katharina.drexel@bfh.ch>2021-04-13 07:56:58 +0000
commit19fd68ea3f8b9671266750a8230768559d6d8986 (patch)
tree58ed979f99216b9b3c4808e692b3326b659e653b /share/scripts/debconf
parentReplace debian.list by debian.sources. (diff)
downloadcompute-tools-19fd68ea3f8b9671266750a8230768559d6d8986.tar.xz
compute-tools-19fd68ea3f8b9671266750a8230768559d6d8986.zip
MultiMirror boot for mmdebstrap.
Signed-off-by: Katharina Drexel <katharina.drexel@bfh.ch>
Diffstat (limited to 'share/scripts/debconf')
-rwxr-xr-xshare/scripts/debconf121
1 files changed, 120 insertions, 1 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 13209ca..07d9a88 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -372,6 +372,114 @@ EOF
export DEBCONF_SYSTEMRC
}
+Prepare_sourceslist ()
+{
+ PARENT_AREA="$(echo ${PARENT_ARCHIVE_AREAS} | sed -e 's|,| |g')"
+ PARENT_DIST="$(echo ${PARENT_DISTRIBUTION} | sed -e 's|-backports||')"
+
+ case "${PARENT_DIST}" in
+ buster)
+ UPDATES="${PARENT_DIST}/updates"
+ ;;
+
+ *)
+ UPDATES="${PARENT_DIST}-security"
+ ;;
+ esac
+
+ DEBIAN_SOURCES="${DEBCONF_TMPDIR}/debian.sources"
+ DIST="$(echo ${DISTRIBUTION} | sed -e 's|-backports||')"
+
+cat > "${DEBIAN_SOURCES}" << EOF
+# /etc/apt/sources.list.d/debian.sources
+
+Types: deb
+URIs: ${PARENT_MIRROR}
+Suites: ${PARENT_DIST}
+Components: ${PARENT_AREA}
+PDiffs: no
+EOF
+
+ if [ -n "${PARENT_MIRROR_SECURITY}" ]
+ then
+cat >> "${DEBIAN_SOURCES}" << EOF
+
+Types: deb
+URIs: ${PARENT_MIRROR_SECURITY}
+Suites: ${UPDATES}
+Components: ${PARENT_AREA}
+PDiffs: no
+EOF
+ fi
+
+ case "${DIST}" in
+ engywuck*)
+ RELNR=5
+ ;;
+
+ fuchur*)
+ RELNR=6
+ ;;
+ esac
+
+ case "${MODE}" in
+ progress-linux)
+ PROGRESS_SOURCES="${DEBCONF_TMPDIR}/progress-linux.sources"
+ PROGRESS_KEY="${DEBCONF_TMPDIR}/progress-linux-${RELNR}-${DIST}-archive-key.pub"
+ wget -O "${PROGRESS_KEY}" "https://deb.progress-linux.org/packages/project/pgp/progress-linux-${RELNR}-${DIST}-archive-key.pub"
+
+ for ARCHIVE in ${ARCHIVES}
+ do
+ case "${ARCHIVE}" in
+ *-extras)
+ if [ -z "${EXTRAS}" ]
+ then
+ EXTRAS="${ARCHIVE}"
+ else
+ EXTRAS="${EXTRAS} ${ARCHIVE}"
+ fi
+ ;;
+
+ *)
+ if [ -z "${BASE_ARCHIVES}" ]
+ then
+ BASE_ARCHIVES="${ARCHIVE}"
+ else
+ BASE_ARCHIVES="${BASE_ARCHIVES} ${ARCHIVE}"
+ fi
+ ;;
+ esac
+ done
+
+cat > "${PROGRESS_SOURCES}" << EOF
+Types: deb
+URIs: ${MIRROR}
+Suites: ${BASE_ARCHIVES}
+Components: main contrib non-free
+PDiffs: no
+Signed-By: ${PROGRESS_KEY}
+EOF
+
+ if [ -n "${EXTRAS}" ]
+ then
+cat >> "${PROGRESS_SOURCES}" << EOF
+
+Types: deb
+URIs: ${MIRROR}
+Suites: ${EXTRAS}
+Components: main contrib non-free restricted
+PDiffs: no
+Signed-By: ${PROGRESS_KEY}
+EOF
+ fi
+ ;;
+
+ *)
+ PROGRESS_SOURCES=""
+ ;;
+ esac
+}
+
Debootstrap ()
{
DIRECTORY="${1}"
@@ -404,7 +512,7 @@ Debootstrap ()
mmdebstrap)
mmdebstrap --verbose --arch=${ARCHITECTURE} --components=${PARENT_ARCHIVE_AREAS} \
- --mode=root --include=${INCLUDE} ${PARENT_DISTRIBUTION} "${DIRECTORY}" ${PARENT_MIRROR}
+ --mode=root --include=${INCLUDE} ${PARENT_DISTRIBUTION} "${DIRECTORY}" ${DEBIAN_SOURCES} ${PROGRESS_SOURCES}
;;
*)
@@ -442,6 +550,11 @@ EOF
case "${MODE}" in
progress-linux)
+ if [ -f "${DIRECTORY}"/etc/apt/sources.list.d/[[:digit:]]*progress-linux.sources ]
+ then
+ rm -f "${DIRECTORY}"/etc/apt/sources.list.d/[[:digit:]]*progress-linux.sources
+ fi
+
cat > "${DIRECTORY}/progress-linux.cfg" << EOF
progress-linux progress-linux/archives multiselect $(echo ${ARCHIVES} | sed -e 's| |, |g')
progress-linux progress-linux/archive-areas multiselect $(echo ${ARCHIVE_AREAS} | sed -e 's|,| |g')
@@ -1183,6 +1296,12 @@ SYSTEM="${MACHINES}/${NAME}"
## Generic parts
if [ ! -e "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}" ]
then
+ case "${BOOTSTRAP}" in
+ *mmdebstrap)
+ Prepare_sourceslist
+ ;;
+ esac
+
Debootstrap "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}.tmp"
Configure_apt "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}.tmp"
Deconfigure_system "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}.tmp"