29e18dff973632afcdb1ebf98dbc9d38f80a7792vboxsync# Reloads the new kernel extension at the end of installation.
29e18dff973632afcdb1ebf98dbc9d38f80a7792vboxsync# Copyright (C) 2007-2013 Oracle Corporation
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# available from http://www.virtualbox.org. This file is free software;
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# you can redistribute it and/or modify it under the terms of the GNU
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# General Public License (GPL) as published by the Free Software
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync# Make sure the old startup items are gone.
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync rm -vf "/Library/StartupItems/VirtualBox/StartupParameters.plist"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync rm -vf "/Library/StartupItems/VirtualBox/VirtualBox"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync rm -vf "/Library/StartupItems/VirtualBox/Resources/English.lproj/Localizable.strings"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync test -d "/Library/StartupItems/VirtualBox/Resources/English.lproj/" && rmdir "/Library/StartupItems/VirtualBox/Resources/English.lproj/"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync test -d "/Library/StartupItems/VirtualBox/Resources/" && rmdir "/Library/StartupItems/VirtualBox/Resources/"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync test -d "/Library/StartupItems/VirtualBox/" && rmdir "/Library/StartupItems/VirtualBox/"
2907c780b193573627b0c40724bbc1bd0f8e9d34vboxsync# Make sure old kernel extensions are gone (moved to "/Library/Application Support/VirtualBox/" with 4.3).
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync# Install the launchd script.
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsyncrm -vf "/Library/LaunchDaemons/org.virtualbox.startup.plist"
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsyncln -s "../Application Support/VirtualBox/LaunchDaemons/org.virtualbox.startup.plist" \
66ab05d147fcb24a5fec1cd3c37a1799db26c804vboxsync "/Library/LaunchDaemons/org.virtualbox.startup.plist"
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync# Unload any old extension that might be loaded already (ignore failures).
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsyncif kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsyncif kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsyncif kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsyncif kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync# Load the extension, exit on first error.
29e18dff973632afcdb1ebf98dbc9d38f80a7792vboxsynckextload '/Library/Application Support/VirtualBox/VBoxDrv.kext'
29e18dff973632afcdb1ebf98dbc9d38f80a7792vboxsynckextload -d '/Library/Application Support/VirtualBox/VBoxDrv.kext' '/Library/Application Support/VirtualBox/VBoxUSB.kext'
29e18dff973632afcdb1ebf98dbc9d38f80a7792vboxsynckextload -d '/Library/Application Support/VirtualBox/VBoxDrv.kext' '/Library/Application Support/VirtualBox/VBoxNetFlt.kext'