From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- .../VBoxServiceWrapper | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 src/VBox/Additions/darwin/Installer/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper (limited to 'src/VBox/Additions/darwin/Installer/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper') diff --git a/src/VBox/Additions/darwin/Installer/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper b/src/VBox/Additions/darwin/Installer/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper new file mode 100755 index 00000000..864fc76b --- /dev/null +++ b/src/VBox/Additions/darwin/Installer/VBoxGuestAdditionsToolsAndServices/VBoxServiceWrapper @@ -0,0 +1,63 @@ +#!/bin/sh +## @file +# VBoxService wrapper script. +# +# Load required kernel extensions before start service (if necessary). +# + +# +# Copyright (C) 2007-2023 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# SPDX-License-Identifier: GPL-3.0-only +# + +export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" + +echo "Check if kernel extensions loaded..." +items="VBoxGuest" +for item in $items; do + kext_item="org.virtualbox.kext.$item" + loaded=`kextstat | grep $kext_item` + if [ -z "$loaded" ] ; then + echo "Loading $item kernel extension..." + XNU_VERSION=`LC_ALL=C uname -r | LC_ALL=C cut -d . -f 1` + if [ "$XNU_VERSION" -ge "10" ]; then + kextutil /Library/Extensions/$item.kext + else + kextload /Library/Extensions/$item.kext + fi + fi +done + +echo "Check if VBoxClient is added for all non-system users" +for user in $(dscl . -list /Users | grep -v -e'^_' -e'root'); do + system_user="YES" + test -n "$(dscl . -read /Users/$user NFSHomeDirectory | grep '/Users')" && system_user="NO" + if [ "$system_user" = "NO" ]; then + loaded="NO" + test -n "$(sudo -u "$user" launchctl list | grep 'org.virtualbox.additions.vboxclient')" && loaded="YES" + if [ "$loaded" = "NO" ] ; then + echo "Loading org.virtualbox.additions.vboxclient for $user" + sudo -u "$user" launchctl load -F "/Library/LaunchAgents/org.virtualbox.additions.vboxclient.plist" + fi + fi +done + +exec "/Library/Application Support/VirtualBox Guest Additions/VBoxService" -f + -- cgit v1.2.3