From 4987b7dbc364b6067bfdaf3f701541f53e88f156 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 11 Jul 2025 09:15:09 -0700 Subject: [PATCH] Drop backports from debian-minimal by default Historically Debian cloud images included backports sources by default (apparently to ensure that new enough cloud-init could be installed to boot on various clouds). DIB mimicked this behavior and included backports by default in the debian-minimal element. Since then packaging for cloud-init has changed and now upstream cloud images no longer include backports by default. Update debian-minimal to match. Users of debian-minimal can include backports again by setting the DIB_APT_SOURCES_CONF variable in their builds. Or they can add the source as a separate source.list.d entry with custom elements. As part of this change the debootstrap element docs are also updated to reflect the change. One thing that was noticed is that the ubuntu-minimal element uses different variables to manage the apt sources despite relying on the common framework from the debootstrap element. The debootstrap docs are updated to include a note about this difference. Change-Id: Id9f0cacf7707709829e49006d26d6c98dc8a8ba5 Signed-off-by: Clark Boylan --- .../environment.d/10-debian-minimal.bash | 1 - .../elements/debootstrap/README.rst | 18 +++++++++++++----- .../debian-no-backports-38459be7b11febd1.yaml | 10 ++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml diff --git a/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash b/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash index fafb41477..0396528d4 100644 --- a/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash +++ b/diskimage_builder/elements/debian-minimal/environment.d/10-debian-minimal.bash @@ -30,7 +30,6 @@ esac 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 ${DIB_DEBIAN_SECURITY_MIRROR} ${DIB_DEBIAN_SECURITY_PATH}${DIB_DEBIAN_SECURITY_SUBPATH} ${DIB_DEBIAN_COMPONENTS_WS} " diff --git a/diskimage_builder/elements/debootstrap/README.rst b/diskimage_builder/elements/debootstrap/README.rst index e45e5bddf..a31a5689f 100644 --- a/diskimage_builder/elements/debootstrap/README.rst +++ b/diskimage_builder/elements/debootstrap/README.rst @@ -9,9 +9,10 @@ debian-minimal or ubuntu-minimal to get an actual base image. There are two ways to configure apt-sources: -1. Using the standard way of defining the default, backports, updates - and security repositories is the default. In this case you can - overwrite the two environment variables to adapt the behavior: +1. Using the standard way of defining the default apt sources + release, updates and security repositories is the default. In this + case you can overwrite the two environment variables to adapt the + behavior: * ``DIB_DISTRIBUTION_MIRROR``: the mirror to use (default: ``__) @@ -24,8 +25,9 @@ There are two ways to configure apt-sources: ``debootstrap`` element has been set, that list of components will be used instead. - Backports, updates and security are included unless ``DIB_RELEASE`` - is ``unstable``. + Updates and security are included unless ``DIB_RELEASE`` + is ``testing`` or ``unstable``. For these ``DIB_RELEASE`` values only + the default release source is included. 2. Complete configuration given in the variable ``DIB_APT_SOURCES_CONF``. @@ -63,6 +65,12 @@ For further information about ``DIB_DEBIAN_DEBOOTSTRAP_SCRIPT`` , ``DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE`` and ``DIB_DEBOOTSTRAP_EXTRA_ARGS`` please consult "README.rst" of the debootstrap element. +.. note:: + + The rules above primarily apply to the debian-minimal element. The + ubuntu-minimal element uses different configuration vars for things + like configuring apt sources and its defaults may differ. + ---------- Networking ---------- diff --git a/releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml b/releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml new file mode 100644 index 000000000..a38e1c7d4 --- /dev/null +++ b/releasenotes/notes/debian-no-backports-38459be7b11febd1.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + Debian images built with the debian-minimal element will no longer + include the backports repository in sources.list.d by default. This + change updates DIB built images to better match the configuration + of upstream Debian cloud images. Users who wish to continue to + include backports repo sources in their images can set + DIB_APT_SOURCES_CONF to include backports or have a custom element + add the source configuration to their images.