VirtualBox

Changeset 48928 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Oct 7, 2013 4:13:23 PM (11 years ago)
Author:
vboxsync
Message:

Replaced VBoxStartupItems with a launch script and plist located in the VBoxKEXTs pacakge. To provide a script for loading, loading and reloading drivers manually, I modified the existing startup item script instead of cleanup up the intendation of the proposed vbox kext keeper script.

Location:
trunk/src/VBox/Installer/darwin
Files:
1 added
1 deleted
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/darwin/DiskImage/VirtualBox_Uninstall.tool

    r48924 r48928  
    5858test -d /Library/Receipts/VBoxStartupItems.pkg/    && my_directories+=("/Library/Receipts/VBoxStartupItems.pkg/")
    5959
     60test -d "/Library/Application Support/VirtualBox/LaunchDaemons/"    && my_directories+=("/Library/Application Support/VirtualBox/LaunchDaemons/")
    6061test -d "/Library/Application Support/VirtualBox/VBoxDrv.kext/"     && my_directories+=("/Library/Application Support/VirtualBox/VBoxDrv.kext/")
    6162test -d "/Library/Application Support/VirtualBox/VBoxUSB.kext/"     && my_directories+=("/Library/Application Support/VirtualBox/VBoxUSB.kext/")
     
    8283test -f /usr/bin/vbox-img                          && my_files+=("/usr/bin/vbox-img")
    8384test -d /Library/Receipts/VirtualBoxCLI.pkg/       && my_directories+=("/Library/Receipts/VirtualBoxCLI.pkg/")
     85test -f /Library/LaunchDaemons/org.virtualbox.startup.plist && my_files+=("/Library/LaunchDaemons/org.virtualbox.startup.plist")
    8486
    8587test -d /Applications/VirtualBox.app/              && my_directories+=("/Applications/VirtualBox.app/")
  • trunk/src/VBox/Installer/darwin/Makefile.kmk

    r48926 r48928  
    166166#
    167167$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg: \
    168                 $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg \
    169168                $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
    170169                $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
     
    272271        $(MKDIR) -p -m 0755 \
    273272                $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
     273                $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
    274274                $(foreach kext,$(VBOX_DI_KEXTS), \
    275275                        $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
    276276                        $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
    277277                        $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
     278        @# Copy the launch daemon bits.
     279        $(INSTALL) -m 0755  $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh          $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
     280        $(INSTALL) -m 0644  $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist  $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
    278281        @# Copy the common files (Info.plist).
    279282        $(foreach kext,$(VBOX_DI_KEXTS), \
     
    331334                $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
    332335                $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
    333 
    334 
    335 #
    336 # The VirtualBox Startupitems.
    337 #
    338 $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg: \
    339                 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/* \
    340                             $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/*.lproj/*) \
    341                 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxStartupItems/* \
    342                             $(VBOX_PATH_DI_SRC)/VBoxStartupItems/*.lproj/*) \
    343                 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
    344                         $(VBOX_BRAND_$(f)_VBOXSTARTUPITEMS_DESCRIPTION_PLIST)) \
    345                 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
    346         $(call MSG_TOOL,pkgbuild,,,$@)
    347         @# Cleanup any previously failed attempts.
    348         sudo rm -Rf \
    349                 $@ \
    350                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
    351                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
    352                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
    353         @# Correct directory permissions are important.
    354         $(MKDIR) -p \
    355                 $(@D) \
    356                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
    357                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res \
    358                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res/English.lproj
    359         $(MKDIR) -p -m 0775 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
    360         $(MKDIR) -p -m 0755 \
    361                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems \
    362                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox \
    363                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources \
    364                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj
    365         @# Copy the files.
    366         $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/StartupParameters.plist                     $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
    367         $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/VirtualBox                                  $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/
    368         $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/VirtualBox/Resources/English.lproj/
    369         @# Set the correct owners.
    370         sudo chown    root:admin $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
    371         sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems
    372         @# Build the package.
    373         $(VBOX_PKGBUILD) \
    374                 --root   $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library/StartupItems/ \
    375                 --identifier org.virtualbox.pkg.vboxstartupitems \
    376                 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
    377                 --install-location /Library/StartupItems/ \
    378                 --ownership preserve \
    379                 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
    380                 $@
    381         @# Cleanup
    382         sudo chown -R "$(shell whoami)" \
    383                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root/Library
    384         sudo rm -Rf \
    385                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.root \
    386                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.desc \
    387                 $(VBOX_PATH_PACK_TMP)/VBoxStartupItems.pkg.res
    388336
    389337
     
    949897VBoxKEXTs.pkg:        $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
    950898VirtualBoxCLI.pkg:    $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
    951 VBoxStartupItems.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxStartupItems.pkg
    952899VirtualBox.pkg:       $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
    953900VirtualBox.mpkg:      $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
  • trunk/src/VBox/Installer/darwin/VBoxKEXTs/VirtualBoxStartup.sh

    • Property svn:keywords set to Author Date Id Revision
    r48924 r48928  
    1818#
    1919
    20 . /etc/rc.common
     20if false; then
     21    . /etc/rc.common
     22else
     23    # Fake the startup item functions we're using.
     24
     25    ConsoleMessage()
     26    {
     27        if [ "$1" != "-f" ]; then
     28            echo "$@"
     29        else
     30            shift
     31            echo "Fatal error: $@"
     32            exit 1;
     33        fi
     34    }
     35
     36    RunService()
     37    {
     38        case "$1" in
     39            "start")
     40                StartService
     41                exit $?;
     42                ;;
     43            "stop")
     44                StopService
     45                exit $?;
     46                ;;
     47            "restart")
     48                RestartService
     49                exit $?;
     50                ;;
     51            "launchd")
     52                if RestartService; then
     53                    while true;
     54                    do
     55                        sleep 3600
     56                    done
     57                fi
     58                exit $?;
     59                ;;
     60             **)
     61                echo "Error: Unknown action '$1'"
     62                exit 1;
     63        esac                   
     64    }
     65fi
    2166
    2267
  • trunk/src/VBox/Installer/darwin/VBoxKEXTs/postflight

    r48924 r48928  
    1616# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1717#
     18
     19#
     20# Make sure the old startup items are gone.
     21#
     22if [ -d /Library/StartupItems/VirtualBox/ ]; then
     23    rm -vf  "/Library/StartupItems/VirtualBox/StartupParameters.plist"
     24    rm -vf  "/Library/StartupItems/VirtualBox/VirtualBox"
     25    rm -vf  "/Library/StartupItems/VirtualBox/Resources/English.lproj/Localizable.strings"
     26    test -d "/Library/StartupItems/VirtualBox/Resources/English.lproj/" && rmdir "/Library/StartupItems/VirtualBox/Resources/English.lproj/"
     27    test -d "/Library/StartupItems/VirtualBox/Resources/"               && rmdir "/Library/StartupItems/VirtualBox/Resources/"
     28    test -d "/Library/StartupItems/VirtualBox/"                         && rmdir "/Library/StartupItems/VirtualBox/"
     29fi
     30
     31#
     32# Install the launchd script.
     33#
     34rm -vf "/Library/LaunchDaemons/org.virtualbox.startup.plist"
     35set -e
     36ln -s  "../Application Support/VirtualBox/LaunchDaemons/org.virtualbox.startup.plist" \
     37       "/Library/LaunchDaemons/org.virtualbox.startup.plist"
     38set +e
    1839
    1940#
  • trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Localizable.strings

    r43008 r48928  
    22
    33'choiceVBoxKEXTs_title' = '@VBOX_PRODUCT@ Kernel Extensions';
    4 'choiceVBoxKEXTs_msg' = 'Installs the @VBOX_PRODUCT@ Kernel Extensions into /Library/Extensions.';
    5 
    6 'choiceVBoxStartup_title' = '@VBOX_PRODUCT@ Startup Items';
    7 'choiceVBoxStartup_msg' = 'Installs the @VBOX_PRODUCT@ Startup Items to /Library/StartupItems/VirtualBox.';
     4'choiceVBoxKEXTs_msg' = 'Installs the @VBOX_PRODUCT@ Kernel Extensions into /Library/Application Support/VirtualBox;
    85
    96'choiceVBox_title' = '@VBOX_PRODUCT@';
  • trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution.dist

    r47894 r48928  
    7878    <choices-outline>
    7979        <line choice="choiceVBoxKEXTs"></line>
    80         <line choice="choiceVBoxStartup"></line>
    8180        <line choice="choiceVBox"></line>
    8281        <line choice="choiceVBoxCLI"></line>
     
    8483    <choice id="choiceVBoxKEXTs"   title="choiceVBoxKEXTs_title"   description="choiceVBoxKEXTs_msg"   start_selected="true" start_enabled="false" start_visible="true">
    8584        <pkg-ref id="org.virtualbox.pkg.vboxkexts"></pkg-ref>
    86     </choice>
    87     <choice id="choiceVBoxStartup" title="choiceVBoxStartup_title" description="choiceVBoxStartup_msg" start_selected="true" start_enabled="false" start_visible="true">
    88         <pkg-ref id="org.virtualbox.pkg.vboxstartupitems"></pkg-ref>
    8985    </choice>
    9086    <choice id="choiceVBox"        title="choiceVBox_title"        description="choiceVBox_msg"        start_selected="true" start_enabled="false" start_visible="true">
     
    9591    </choice>
    9692    <pkg-ref id="org.virtualbox.pkg.vboxkexts" auth="Root">file:./Contents/Packages/VBoxKEXTs.pkg</pkg-ref>
    97     <pkg-ref id="org.virtualbox.pkg.vboxstartupitems" auth="Root">file:./Contents/Packages/VBoxStartupItems.pkg</pkg-ref>
    9893    <pkg-ref id="org.virtualbox.pkg.virtualbox" auth="Root">file:./Contents/Packages/VirtualBox.pkg</pkg-ref>
    9994    <pkg-ref id="org.virtualbox.pkg.virtualboxcli" auth="Root">file:./Contents/Packages/VirtualBoxCLI.pkg</pkg-ref>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette