VirtualBox

Changeset 57868 in vbox


Ignore:
Timestamp:
Sep 23, 2015 12:32:40 PM (9 years ago)
Author:
vboxsync
Message:

Installers/linux: fix some dkms handling.

Location:
trunk/src/VBox/Installer/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/prerm-common.sh

    r57811 r57868  
    3131. "./routines.sh"
    3232
     33DO_DKMS=
     34VERSION=
     35while true
     36do
     37    test -z "${1}" && break
     38    case "${1}" in
     39        --dkms)
     40            DO_DKMS=true
     41            shift
     42            VERSION="${1}"
     43            if test -z "${VERSION}"; then
     44                echo "--dkms requires a version"
     45                exit 1
     46            fi
     47            ;;
     48        *)
     49            echo "Bad argument ${1}" >&2
     50            exit 1
     51            ;;
     52    esac
     53    shift
     54done
     55
    3356# Stop the ballon control service
    3457stop_init_script vboxballoonctrl-service 2>/dev/null
     
    3760# Stop the web service
    3861stop_init_script vboxweb-service 2>/dev/null
    39 # Do this check here after we terminated the web service
     62# Do this check here after we terminated the web service: check whether VBoxSVC
     63# is running and exit if it can't be stopped.
    4064check_running
    4165# Terminate VBoxNetDHCP if running
     
    4973delrunlevel vboxweb-service
    5074remove_init_script vboxweb-service
     75DKMS=`which dkms 2>/dev/null`
     76if test "$DO_DKMS" = true && test -n "$DKMS"; then
     77  $DKMS remove -m vboxhost -v "${VERSION}" --all > /dev/null 2>&1
     78  $DKMS remove -m vboxdrv -v "${VERSION}" --all > /dev/null 2>&1
     79  $DKMS remove -m vboxnetflt -v "${VERSION}" --all > /dev/null 2>&1
     80  $DKMS remove -m vboxnetadp -v "${VERSION}" --all > /dev/null 2>&1
     81fi
    5182# Stop kernel module and uninstall runlevel script
    5283stop_init_script vboxdrv 2>/dev/null
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r57812 r57868  
    321321    /sbin/rcvboxdrv stop || true
    322322  fi
    323   if [ $REGISTER_MODULES -eq 1 ]; then
    324     DKMS=`which dkms 2>/dev/null`
    325     if [ -n "$DKMS" ]; then
    326       $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
    327     fi
    328   fi
    329323fi
    330324# Install and start the new service scripts.
    331 /usr/lib/virtualbox/prerm-common.sh
    332 /usr/lib/virtualbox/postinst-common.sh /usr/lib/virtualbox --start > /dev/null
     325PRERM_DKMS=
     326test "${REGISTER_MODULES}" = 1 && PRERM_DKMS="--dkms %VER%"
     327POSTINST_START=--start
     328test "${INSTALL_NO_VBOXDRV}" = 1 && POSTINST_START=
     329/usr/lib/virtualbox/prerm-common.sh ${PRERM_DKMS} || true
     330/usr/lib/virtualbox/postinst-common.sh /usr/lib/virtualbox "${POSTINST_START}" > /dev/null || true
    333331
    334332
    335333%preun
     334# Called before the package is removed, or during upgrade after (not before)
     335# the new version's "post" scriptlet.
    336336# $1==0: remove the last version of the package
    337 # $1==1: install the first time
    338 # $1>=2: upgrade
     337# $1>=1: upgrade
    339338if [ "$1" = 0 ]; then
    340   /usr/lib/virtualbox/prerm-common.sh || exit 1
     339  /usr/lib/virtualbox/prerm-common.sh --dkms || exit 1
    341340  rm -f /etc/udev/rules.d/60-vboxdrv.rules
    342341  rm -f /etc/vbox/license_agreed
    343342  rm -f /etc/vbox/module_not_compiled
    344343fi
    345 DKMS=`which dkms 2>/dev/null`
    346 if [ -n "$DKMS" ]; then
    347   $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
    348 fi
    349 
    350344
    351345%postun
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