From 793a93bc4331acad78c1b8190cc6faea41b66c12 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 20 Jul 2023 19:08:32 +0200 Subject: [PATCH] MT#57453 vagrant_configuration: remove fake systemd presence after execution Let's restore system state of /run/systemd/system for VBoxLinuxAdditions, to avoid any unexpected side effects. Followup for git rev 8601193 Change-Id: I632c7d60ebb627c3a80d4c1f9b264d6d0a13b4f1 --- templates/scripts/includes/deployment.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index c2735c1..d3c15de 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1099,10 +1099,12 @@ vagrant_configuration() { FAKE_UNAME='/tmp/fake-uname.so' fi -# if ! [ -d "${TARGET}/run/systemd/system" ] ; then + local vbox_systemd_workaround=false + if ! [ -d "${TARGET}/run/systemd/system" ] ; then echo "Creating /run/systemd/system for systemd detection within VBoxLinuxAdditions" mkdir -p "${TARGET}/run/systemd/system" -# fi + vbox_systemd_workaround=true + fi grml-chroot "${TARGET}" env \ UTS_RELEASE="${KERNELVERSION}" LD_PRELOAD="${FAKE_UNAME}" \ @@ -1110,6 +1112,11 @@ vagrant_configuration() { tail -10 "${TARGET}/var/log/vboxadd-install.log" umount "${TARGET}/media/cdrom/" + if "${vbox_systemd_workaround}" ; then + echo "Removing /run/systemd/system workaround for VBoxLinuxAdditions again" + rmdir "${TARGET}/run/systemd/system" || true + fi + # VBoxLinuxAdditions.run chooses /usr/lib64 as soon as this directory exists, which # is the case for our PRO systems shipping the heartbeat-2 package; then the # symlink /sbin/mount.vboxsf points to the non-existing /usr/lib64/VBoxGuestAdditions/mount.vboxsf