VirtualBox

Changeset 66387 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Mar 31, 2017 6:33:26 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114336
Message:

bugref:8524: Additions/linux: play nicely with distribution-installed Additions: add an uninstaller script in a well-known location (namely, /usr/sbin/vbox-uninstall-guest-additions) that distribution Additions packages can use to uninstall our Additions before putting themselves in place. Vice-versa, distribution-installed Additions should create an executable at the same path to let us uninstall them if the user wants to install our package.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/install.sh.in

    r64788 r66387  
    1717#
    1818
    19 # This is a stub installation script to be included in VirtualBox Makeself
    20 # installers which removes any previous installations of the package, unpacks
    21 # the package into the filesystem (by default under /opt) and starts the real
    22 # installation script.
    23 #
    2419PATH=$PATH:/bin:/sbin:/usr/sbin
    2520
     
    2823PACKAGE_NAME="VirtualBox Guest Additions"
    2924UNINSTALL="uninstall.sh"
     25PUBLIC_UNINSTALL_HOOK="/usr/sbin/vbox-uninstall-guest-additions"
    3026ROUTINES="routines.sh"
    3127INSTALLATION_VER="_VERSION_"
     
    300296
    301297# uninstall any previous installation
     298# If the currently installed Additions have provided an uninstallation hook, try
     299# that first.
     300if test -x "${PUBLIC_UNINSTALL_HOOK}"; then
     301  "${PUBLIC_UNINSTALL_HOOK}" 1>&2 ||
     302    abort "Failed to remove existing installation.  Aborting..."
     303fi
     304
    302305INSTALL_DIR=""
    303306uninstalled=0
     
    529532  echo "$INSTALLATION_DIR/" >> "$CONFIG_DIR/$CONFIG_FILES"
    530533
     534cat > "${PUBLIC_UNINSTALL_HOOK}" << EOF
     535#!/bin/sh
     536# This executable provides a well-known way to uninstall VirtualBox Guest
     537# Additions in order to re-install them from a different source.  A common case
     538# is uninstalling distribution-provide Additions to install the version provided
     539# by VirtualBox.  Distributions should put the right command in here to do the
     540# removal, e.g. "dnf remove VirtualBox-guest-additions".  Leaving kernel modules
     541# provided by the distribution kernel package in place is acceptable if the
     542# location does not clash with the VirtualBox-provided module location (misc).
     543$INSTALLATION_DIR/$UNINSTALL
     544EOF
     545chmod 0755 "${PUBLIC_UNINSTALL_HOOK}"
     546echo "$PUBLIC_UNINSTALL_HOOK" >> "$CONFIG_DIR/$CONFIG_FILES"
     547
    531548# Test for a problem with old Mesa versions which stopped our 3D libraries
    532549# from working.  Known to affect Debian 7.11, probably OL/RHEL 5.
Note: See TracChangeset for help on using the changeset viewer.

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