From 0dd8ba52bb884b29f287fce6bc6c6e9040858639 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 15 Apr 2020 18:51:41 +0200 Subject: [PATCH] TT#80000 Switch to the packaged VirtualBox Guest Additions ISO Instead of having to maintain this ISO in our web server off-band, we switch to use the packaged version, which makes validation unnecessary as apt gives us that. And it also gives us a newer version (currently 6.0.4 with Debian buster 10.3 vs the old 5.2.26). Change-Id: Id89280bbe7fadeb35d391b5dc46e930935017588 --- grml_build/package_config/SIPWISE | 1 + templates/scripts/includes/deployment.sh | 22 +++++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/grml_build/package_config/SIPWISE b/grml_build/package_config/SIPWISE index 05fae88..ecef27f 100644 --- a/grml_build/package_config/SIPWISE +++ b/grml_build/package_config/SIPWISE @@ -68,6 +68,7 @@ tzdata unp unzip util-linux +virtualbox-guest-additions-iso vlan wget whois diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index ef31f13..bf058f9 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -86,13 +86,9 @@ VLAN_SIP_EXT=1719 VLAN_SIP_INT=1720 VLAN_HA_INT=1721 VLAN_RTP_EXT=1722 -VIRTUALBOX_DIR="/usr/share/virtualbox" -VIRTUALBOX_ISO="VBoxGuestAdditions_5.2.26.iso" -VIRTUALBOX_ISO_CHECKSUM="b927c5d0d4c97a9da2522daad41fe96b616ed06bfb0c883f9c42aad2244f7c38" # sha256 -VIRTUALBOX_ISO_URL_PATH="/files/${VIRTUALBOX_ISO}" SIPWISE_APT_KEY_PATH="/etc/apt/trusted.gpg.d/sipwise-keyring-bootstrap.gpg" NGCP_PXE_INSTALL=false -ADDITIONAL_PACKAGES=(git augeas-tools gdisk) +ADDITIONAL_PACKAGES=(git augeas-tools gdisk virtualbox-guest-additions-iso) ### helper functions {{{ @@ -235,16 +231,6 @@ ensure_recent_package_versions() { done } -install_vbox_iso() { - echo "Downloading virtualbox-guest-additions ISO" - - mkdir -p "${VIRTUALBOX_DIR}" - vbox_isofile="${VIRTUALBOX_DIR}/${VIRTUALBOX_ISO}" - wget --retry-connrefused --no-verbose -c -O "$vbox_isofile" "${SIPWISE_URL}${VIRTUALBOX_ISO_URL_PATH}" - - echo "${VIRTUALBOX_ISO_CHECKSUM} ${vbox_isofile}" | sha256sum --check || die "Error: failed to compute checksum for Virtualbox ISO. Exiting." -} - set_custom_grub_boot_options() { echo "Adjusting default GRUB boot options (enabling net.ifnames=0)" sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 net.ifnames=0"/' "${TARGET}/etc/default/grub" @@ -1862,8 +1848,6 @@ vagrant_configuration() { sed -ri -e "s/mesg\s+n/# adjusted for Vagrant\ntty -s \&\& mesg n/" "${TARGET}/root/.profile" fi - install_vbox_iso - # shellcheck disable=SC2010 KERNELHEADERS=$(basename "$(ls -d ${TARGET}/usr/src/linux-headers*amd64 | grep -v -- -rt-amd64 | sort -u -r -V | head -1)") if [ -z "$KERNELHEADERS" ] ; then @@ -1874,6 +1858,10 @@ vagrant_configuration() { die "Error: no kernel version could be identified." fi + local VIRTUALBOX_DIR="/usr/share/virtualbox" + local VIRTUALBOX_ISO="VBoxGuestAdditions.iso" + lcoal vbox_isofile="${VIRTUALBOX_DIR}/${VIRTUALBOX_ISO}" + if [ ! -r "$vbox_isofile" ] ; then die "Error: could not find $vbox_isofile" fi