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 --- .../darwin/VirtualBox/PkgBuildComponent.plist | 17 +++ .../darwin/VirtualBox/VBoxAutostartDarwin.sh | 71 +++++++++++++ .../VirtualBox/org.virtualbox.vboxautostart.plist | 19 ++++ .../org.virtualbox.vboxballoonctrl.plist | 14 +++ .../VirtualBox/org.virtualbox.vboxwebsrv.plist | 26 +++++ src/VBox/Installer/darwin/VirtualBox/postflight | 117 +++++++++++++++++++++ src/VBox/Installer/darwin/VirtualBox/preflight | 41 ++++++++ 7 files changed, 305 insertions(+) create mode 100644 src/VBox/Installer/darwin/VirtualBox/PkgBuildComponent.plist create mode 100755 src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh create mode 100644 src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxautostart.plist create mode 100644 src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxballoonctrl.plist create mode 100644 src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxwebsrv.plist create mode 100755 src/VBox/Installer/darwin/VirtualBox/postflight create mode 100755 src/VBox/Installer/darwin/VirtualBox/preflight (limited to 'src/VBox/Installer/darwin/VirtualBox') diff --git a/src/VBox/Installer/darwin/VirtualBox/PkgBuildComponent.plist b/src/VBox/Installer/darwin/VirtualBox/PkgBuildComponent.plist new file mode 100644 index 00000000..a67ae42c --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/PkgBuildComponent.plist @@ -0,0 +1,17 @@ + + + + + + RootRelativeBundlePath VirtualBox.app + BundleIsRelocatable + BundleIsVersionChecked + BundleHasStrictIdentifier + BundleOverwriteAction upgrade + BundlePreInstallScriptPath preflight + BundlePostInstallScriptPath postflight + + + + + diff --git a/src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh b/src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh new file mode 100755 index 00000000..03672d8c --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# +# Copyright (C) 2012-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 +# + +# +# Wrapper for the per user autostart daemon. Gets a list of all users +# and starts the VMs. +# + +function vboxStartStopAllUserVms() +{ + # Go through the list and filter out all users without a shell and a + # non existing home. + for user in `dscl . -list /Users` + do + HOMEDIR=`dscl . -read /Users/"${user}" NFSHomeDirectory | sed 's/NFSHomeDirectory: //g'` + USERSHELL=`dscl . -read /Users/"${user}" UserShell | sed 's/UserShell: //g'` + + # Check for known home directories and shells for daemons + if [[ "${HOMEDIR}" == "/var/empty" || "${HOMEDIR}" == "/dev/null" || "${HOMEDIR}" == "/var/root" + || "${USERSHELL}" == "/usr/bin/false" || "${USERSHELL}" == "/dev/null" || "${USERSHELL}" == "/usr/sbin/uucico" ]] + then + continue + fi + + case "${1}" in + start) + # Start the daemon + su "${user}" -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --start --background --config ${CONFIG}" + ;; + stop) + # Stop the daemon + su "${user}" -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --stop --config ${CONFIG}" + ;; + *) + echo "Usage: start|stop" + exit 1 + esac + done +} + +function vboxStopAllUserVms() +{ + vboxStartStopAllUserVms "stop" +} + +CONFIG=${1} +vboxStartStopAllUserVms "start" +trap vboxStopAllUserVms HUP KILL TERM + + diff --git a/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxautostart.plist b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxautostart.plist new file mode 100644 index 00000000..ca0b770e --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxautostart.plist @@ -0,0 +1,19 @@ + + + + + Disabled + + Label + org.virtualbox.vboxautostart + ProgramArguments + + /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostartDarwin.sh + /etc/vbox/autostart.cfg + + RunAtLoad + + LaunchOnlyOnce + + + diff --git a/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxballoonctrl.plist b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxballoonctrl.plist new file mode 100644 index 00000000..f70805f0 --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxballoonctrl.plist @@ -0,0 +1,14 @@ + + + + + Disabled + + KeepAlive + + Label + org.virtualbox.vboxballoonctrl + Program + /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl + + diff --git a/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxwebsrv.plist b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxwebsrv.plist new file mode 100644 index 00000000..95cbf994 --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxwebsrv.plist @@ -0,0 +1,26 @@ + + + + + Disabled + + KeepAlive + + Label + org.virtualbox.vboxwebsvc + Program + /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv + Sockets + + Listeners + + SockServiceName + 18083 + SockType + stream + SockFamily + IPv4 + + + + diff --git a/src/VBox/Installer/darwin/VirtualBox/postflight b/src/VBox/Installer/darwin/VirtualBox/postflight new file mode 100755 index 00000000..742ee221 --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/postflight @@ -0,0 +1,117 @@ +#!/bin/sh +# $Id: postflight $ +## @file +# Post installation script. +# + +# +# 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 +# + +CPDIR="/bin/cp -f -R" +INSTALL=/usr/bin/install + + +# +# Install the Python bindings +# +VBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS +PYTHON="python python2.3 python2.5 python2.6 python2.7" +if [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then + for p in $PYTHON; do + # Install the python bindings if python is in the path + if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then + echo 1>&2 "Python found: ${p}, installing bindings..." + # Pass install path via environment + export VBOX_INSTALL_PATH + /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install" + /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py clean --all" + fi + done +fi + +# +# Install the vboxweb service file for launchd +# +VBOXWEBSRV="${VBOX_INSTALL_PATH}/org.virtualbox.vboxwebsrv.plist" +VBOXWEBSRV_TRG="${HOME}/Library/LaunchAgents" +if [ -e "${VBOXWEBSRV}" -a -e "${VBOXWEBSRV_TRG}" ]; then + echo "Installing vboxwebsrv launchd file to ${VBOXWEBSRV_TRG}" + if [ "x" != "x${USER}" ]; then + ${INSTALL} -S -o "${USER}" -m 0644 "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/" + else + ${INSTALL} -S -m 0644 "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/" + fi +fi + +# +# Install any custom files +# +DATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.." +if [ -d "${DATAPATH}/.custom" ]; then + echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}..."; + ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom" +fi + +# +# Register our file extensions +# +LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister +if [ -e "${LSREGISTER}" -a "x" != "x${USER}" ]; then + echo "Register file extensions for \"${USER}\"" + /usr/bin/sudo -u "${USER}" ${LSREGISTER} -f /Applications/VirtualBox.app + /usr/bin/sudo -u "${USER}" ${LSREGISTER} -f /Applications/VirtualBox.app/Contents/Resources/vmstarter.app +fi + +# Check environment. +if [ "${INSTALLER_TEMP}x" == "x" ]; then + echo "Required environment variable INSTALLER_TEMP is missing. Aborting installation." + exit 1; +fi + +# Restore previously installed Extension Packs (if any) +if [ -d "${INSTALLER_TEMP}/ExtensionPacks" ]; then + cp -r "${INSTALLER_TEMP}/ExtensionPacks" "${VBOX_INSTALL_PATH}" + rm -rf "${INSTALLER_TEMP}/ExtensionPacks" +fi + +# +# Correct the ownership of the directories in case there +# was an existing installation. +# +chown -R root:admin /Applications/VirtualBox.app + +# +# Workaround for 10.11 beta 6 in which the above chown strips the set-uid-to-root bit. +# +SET_UID_BINARIES="MacOS/VBoxNetAdpCtl" +SET_UID_BINARIES="${SET_UID_BINARIES} MacOS/VBoxHeadless MacOS/VBoxNetDHCP MacOS/VBoxNetNAT Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM" # WITH_HARDENING +for bin in ${SET_UID_BINARIES}; do + chmod u+s "/Applications/VirtualBox.app/Contents/${bin}" +done + +# Install provisioning profile if present, needed by VBoxHeadless. +if [ -f /Applications/VirtualBox.app/Contents/embedded.provisionprofile ]; then + profiles -i -F /Applications/VirtualBox.app/Contents/embedded.provisionprofile +fi + +exit 0; + diff --git a/src/VBox/Installer/darwin/VirtualBox/preflight b/src/VBox/Installer/darwin/VirtualBox/preflight new file mode 100755 index 00000000..b604ea63 --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/preflight @@ -0,0 +1,41 @@ +#!/bin/sh + +# +# 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 +# + +set -e + +# Check environment. +if [ "x${INSTALLER_TEMP}" = "x" ]; then + echo "Required environment variable INSTALLER_TEMP is missing. Aborting installation." + exit 1; +fi + +# Backup previously installed Extension Packs before +# installation process will completely remove previously installed +# VirtualBox distribution. +EXTPACKS_ROOT_PATH="/Applications/VirtualBox.app/Contents/MacOS/ExtensionPacks" +if [ -d "${EXTPACKS_ROOT_PATH}" ]; then + cp -r "${EXTPACKS_ROOT_PATH}" "${INSTALLER_TEMP}" +fi + +exit 0; -- cgit v1.2.3