diff options
Diffstat (limited to '')
-rw-r--r-- | share/config/container.conf.in | 1 | ||||
-rw-r--r-- | share/man/container-create.1.txt | 3 | ||||
-rwxr-xr-x | share/scripts/debconf | 27 | ||||
-rwxr-xr-x | share/scripts/debconf.d/0003-debconf | 21 | ||||
-rwxr-xr-x | share/scripts/debootstrap | 2 |
5 files changed, 46 insertions, 8 deletions
diff --git a/share/config/container.conf.in b/share/config/container.conf.in index ebf91b9..d930803 100644 --- a/share/config/container.conf.in +++ b/share/config/container.conf.in @@ -5,6 +5,7 @@ cnt.auto=@CNT_AUTO@ cnt.container-server=@CNT_CONTAINER_SERVER@ cnt.network-bridge=@CNT_NETWORK_BRIDGE@ cnt.overlay=@CNT_OVERLAY@ +cnt.overlay-options=@CNT_OVERLAY_OPTIONS@ bind=@BIND@ bind-ro=@BIND_RO@ boot=@BOOT@ diff --git a/share/man/container-create.1.txt b/share/man/container-create.1.txt index 7770d9b..2ba95de 100644 --- a/share/man/container-create.1.txt +++ b/share/man/container-create.1.txt @@ -67,6 +67,9 @@ The following container-create options are available: *--cnt-overlay='DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED[;DIRECTORY_UPPER:DIRECTORY_LOWER:DIRECTORY_WORK:DIRECTORY_MERGED]'*:: Specify container overlay mounts, see Documentation/filesystems/overlayfs.txt. +*--cnt.overlay-options='OPTION1,OPTION2[;OPTION3,OPTION4]'*:: + Specify container overlay mount options, see Documentation/filesystems/overlayfs.txt. + SCRIPTS ------- diff --git a/share/scripts/debconf b/share/scripts/debconf index 197791a..be0fae0 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -167,6 +167,7 @@ Mount () then CNT_OVERLAYS="$(echo ${CNT_OVERLAY} | sed -e 's|;| |g')" + COUNT="0" for CNT_OVERLAY in ${CNT_OVERLAYS} do DIRECTORY_LOWER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $1 }')" @@ -174,12 +175,23 @@ Mount () DIRECTORY_WORK="$(echo ${CNT_OVERLAY} | awk -F: '{ print $3 }')" DIRECTORY_MERGED="$(echo ${CNT_OVERLAY} | awk -F: '{ print $4 }')" + COUNT="$((${COUNT} + 1))" + CNT_OVERLAY_OPTION="$(echo ${CNT_OVERLAY_OPTIONS} | awk -F ';' "{ print \$${COUNT} }")" + for DIRECTORY in "${DIRECTORY_LOWER}" "${DIRECTORY_UPPER}" "${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" do mkdir -p "${DIRECTORY}" done - mount -t overlay overlay-${NAME} -olowerdir="${DIRECTORY_LOWER}",upperdir="${DIRECTORY_UPPER}",workdir="${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" + if ! findmnt -n -o SOURCE "${DIRECTORY_MERGED}" | grep -qs '^overlay-' + then + if [ -n "${CNT_OVERLAY_OPTION}" ] + then + CNT_OVERLAY_OPTION="-o ${CNT_OVERLAY_OPTION}" + fi + + mount -t overlay overlay-${NAME} ${CNT_OVERLAY_OPTION} -olowerdir="${DIRECTORY_LOWER}",upperdir="${DIRECTORY_UPPER}",workdir="${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" + fi done fi } @@ -205,6 +217,12 @@ Umount () rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} > /dev/null 2>&1 || true done done + + # empty workdir otherwise there might happen stale file handles + if [ -d "${DIRECTORY_WORK}" ] + then + rm --preserve-root --one-file-system -rf "${DIRECTORY_WORK}"/* + fi fi # Unmounting ro bind mounts @@ -499,10 +517,14 @@ EOF for PARENT_REPO in ${PARENT_ARCHIVES} do case "${PARENT_REPO}" in - ${PARENT_DIST}-security) + buster-security) echo "deb ${PARENT_MIRROR_SECURITY} ${PARENT_DIST}/updates ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list" ;; + bullseye-security) + echo "deb ${PARENT_MIRROR_SECURITY} ${PARENT_DIST}-security ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list" + ;; + ${PARENT_DIST}-updates) echo "deb ${PARENT_MIRROR} ${PARENT_DIST}-updates ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list" ;; @@ -1014,6 +1036,7 @@ Commands () -e "s|^cnt.container-server=.*|cnt.container-server=${CNT_CONTAINER_SERVER}|g" \ -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK1_BRIDGE:-bridge0}|g" \ -e "s|^cnt.overlay=.*|cnt.overlay=${CNT_OVERLAY}|g" \ + -e "s|^cnt.overlay-options=.*|cnt.overlay-options=${CNT_OVERLAY_OPTIONS}|g" \ -e "s|^bind=.*|bind=${BIND}|g" \ -e "s|^bind-ro=.*|bind-ro=${BIND_RO}|g" \ -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eno1|g" \ diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf index c5925f2..dc2db47 100755 --- a/share/scripts/debconf.d/0003-debconf +++ b/share/scripts/debconf.d/0003-debconf @@ -53,18 +53,18 @@ Distribution () then case "${MODE}" in debian) - db_subst container/distribution CHOICES "Debian GNU/Linux 9 \"stretch\", Debian GNU/Linux 10 \"buster\", Debian GNU/Linux testing/bullseye, Debian GNU/Linux unstable/sid" + db_subst container/distribution CHOICES "Debian GNU/Linux 9 \"stretch\", Debian GNU/Linux 10 \"buster\", Debian GNU/Linux 11 \"bullseye\", Debian GNU/Linux unstable/sid" db_subst container/distribution CHOICES_C "stretch, buster, bullseye, sid" - db_set container/distribution buster + db_set container/distribution bullseye db_fset container/distribution seen false ;; progress-linux) - db_subst container/distribution CHOICES "Progress Linux 5 (engywuck), Progress Linux 5+ (engywuck-backports)" - db_subst container/distribution CHOICES_C "engywuck, engywuck-backports" + db_subst container/distribution CHOICES "Progress Linux 5 (engywuck), Progress Linux 5+ (engywuck-backports), Progress Linux 6 (fuchur), Progress Linux 6+ (fuchur-backports)" + db_subst container/distribution CHOICES_C "engywuck, engywuck-backports, fuchur, fuchur-backports" - db_set container/distribution engywuck-backports + db_set container/distribution fuchur-backports db_fset container/distribution seen false ;; esac @@ -94,6 +94,10 @@ Parent_distribution () engywuck*) PARENT_DISTRIBUTION="buster" ;; + + fuchur*) + PARENT_DISTRIBUTION="bullseye" + ;; esac ;; @@ -1242,6 +1246,13 @@ Internal_options () fi echo "CNT_OVERLAY=\"${CNT_OVERLAY}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + + if db_get container/overlay-options + then + CNT_OVERLAY_OPTIONS="${RET}" # string (w/ empty) + fi + + echo "CNT_OVERLAY_OPTIONS=\"${CNT_OVERLAY_OPTIONS}\"" >> "${DEBCONF_TMPDIR}/debconf.default" } Mode diff --git a/share/scripts/debootstrap b/share/scripts/debootstrap index f69d006..0130b72 100755 --- a/share/scripts/debootstrap +++ b/share/scripts/debootstrap @@ -153,7 +153,7 @@ then fi ARCHITECTURE="${ARCHITECTURE:-$(dpkg --print-architecture)}" -DISTRIBUTION="${DISTRIBUTION:-buster}" +DISTRIBUTION="${DISTRIBUTION:-bullseye}" MIRROR="${MIRROR:-https://deb.debian.org/debian}" PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}" |