Add security mirror override for debian-minimal

Add option to set the security mirror URL independently in the
debian-minimal element, since this can not be overriden by the
standard DIB_DISTRIBUTION_MIRROR variable.

Change-Id: I145844a410d06a479e68db1bf6d5d0159389305c
This commit is contained in:
Jeremy Stanley 2019-10-02 16:06:47 +00:00 committed by Ian Wienand
parent a77a214339
commit 9b201b58b9
3 changed files with 21 additions and 1 deletions

View File

@ -12,4 +12,11 @@ be created, the variable ``DIB_RELEASE`` can be set appropriately.
Note that this element installs ``systemd-sysv`` as the init system
The element obeys the ``DIB_DISTRIBUTION_MIRROR`` argument for
mirroring (see ``debootsrap`` element documentation). However, the
security repositories are separate for Debian, so we can not assume
they exist at ``DIB_DISTRIBUTION_MIRROR``. If you do not wish to use
the upstream repository (from ``security.debian.org``) override it
with ``DIB_DEBIAN_SECURITY_MIRROR``.
.. element_deps::

View File

@ -6,6 +6,12 @@ if [ -n "${DIB_DEBIAN_DISTRIBUTION_MIRROR:-}" ]; then
fi
export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://deb.debian.org/debian}
# With Debian, security is in a different repository. We can't, say,
# assume "${DIB_DISTRIBUTION_MIRROR}-security" is valid. The only
# choice is for people to add it separately, otherwise we use
# upstream.
DIB_DEBIAN_SECURITY_MIRROR=${DIB_DEBIAN_SECURITY_MIRROR:-http://security.debian.org/}
export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main}
export DIB_DEBIAN_COMPONENTS_WS=${DIB_DEBIAN_COMPONENTS//,/ }
@ -13,7 +19,7 @@ DIB_APT_SOURCES_CONF_DEFAULT=\
"default:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE} ${DIB_DEBIAN_COMPONENTS_WS}
backports:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE}-backports ${DIB_DEBIAN_COMPONENTS_WS}
updates:deb ${DIB_DISTRIBUTION_MIRROR} ${DIB_RELEASE}-updates ${DIB_DEBIAN_COMPONENTS_WS}
security:deb http://security.debian.org/ ${DIB_RELEASE}/updates ${DIB_DEBIAN_COMPONENTS_WS}
security:deb ${DIB_DEBIAN_SECURITY_MIRROR} ${DIB_RELEASE}/updates ${DIB_DEBIAN_COMPONENTS_WS}
"
if [ "${DIB_RELEASE}" = "testing" -o "${DIB_RELEASE}" = "unstable" ]; then

View File

@ -0,0 +1,7 @@
---
features:
- |
A new variable ``DIB_DEBIAN_SECURITY_MIRROR`` is added to override
the path to the security repositories. Previously this was
hard-coded to the upstream repositories, which could get out of
sync with mirrors specified with ``DIB_DISTRIBUTION_MIRROR``.