TT#104221 Use bullseye repos in ensure_packages_installed appropriately

The ensure_packages_installed function ensures that specified packages
are present during runtime. This is used e.g. for installation of
virtualbox-guest-additions-iso Debian package from within
vagrant_configuration(), which is used to execute
/media/cdrom/VBoxLinuxAdditions.run inside the target system.

We can't use random Debian repositories though, as the package
dependencies need to match the running live system. So far we only used
the buster repository, as our current grml-sipwise ISOs are based on
something close to buster.

On the other hand we can't use virtualbox-guest-additions-iso from
Debian/buster in our Debian/bullseye Vagrant boxes, as
/sbin/mount.vboxsf doesn't work then.

So use the bullseye repository if the release of the target system is
bullseye, which seems to work with our current Grml ISOs and current
state of bullseye.

Change-Id: Iaf965daa6ff7a62e2b3bd8c55b8f761abd94c241
mr9.2.1
Michael Prokop 6 years ago
parent 3a5149e01c
commit ed52e8fe7a

@ -274,7 +274,19 @@ ensure_packages_installed() {
"${TMPDIR}/cachedir/archives/partial"
chown _apt -R "${TMPDIR}"
echo "deb ${DEBIAN_URL}/debian/ buster main contrib non-free" > \
local deb_release
case "${DEBIAN_RELEASE}" in
buster|bullseye)
deb_release="${DEBIAN_RELEASE}"
echo "Using ${deb_release} as Debian repository for ${FUNCNAME[0]}"
;;
*)
deb_release='buster'
echo "Enabling fallback to Debian ${deb_release} repository for ${FUNCNAME[0]}"
;;
esac
echo "deb ${DEBIAN_URL}/debian/ ${deb_release} main contrib non-free" > \
"${TMPDIR}/etc/sources.list"
mkdir -p "${TMPDIR}"/etc/apt/apt.conf.d/

Loading…
Cancel
Save