VirtualBox

Changeset 39358 in vbox for trunk/src/VBox/HostDrivers/linux


Ignore:
Timestamp:
Nov 17, 2011 10:25:36 PM (13 years ago)
Author:
vboxsync
Message:

Installers/linux: make do_dkms take arguments instead of requiring patching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/linux/do_dkms

    r32183 r39358  
    1515#
    1616
     17ACTION=
     18if [ "$1" = "install" ]; then
     19  ACTION="install"
     20  MODULE="$2"
     21  VERSION="$3"
     22elif [ "$1" = "uninstall" ]; then
     23  shift
     24  ACTION="uninstall"
     25  OLDMODULES="$*"
     26  break
     27fi
     28
    1729DKMS=`which dkms 2>/dev/null`
    1830if [ -n "$DKMS" ]
    1931then
    20     if [ "$1" = "uninstall" ]; then
     32    if [ "$ACTION" = "uninstall" ]; then
    2133
    2234        echo "Uninstalling modules from DKMS"
    23         for m in _OLDMODULES_
     35        for m in $OLDMODULES
    2436        do
    2537            $DKMS status -m $m | while read line
     
    3749            done
    3850        done
    39         # there should not be any more matches
    40         status=`$DKMS status -m _MODULE_ -v _VERSION_`
    41         if echo $status | grep added > /dev/null ||
    42             echo $status | grep built > /dev/null ||
    43             echo $status | grep installed > /dev/null
    44         then
    45             $DKMS remove -m _MODULE_ -v _VERSION_ --all
    46         fi
    4751        exit 0
    4852
    49     elif [ "$1" = "install" ]; then
     53    elif [ "$ACTION" = "install" ]; then
    5054
    5155        echo "Attempting to install using DKMS"
    52         if $DKMS add -m _MODULE_ -v _VERSION_ &&
    53             $DKMS build -m _MODULE_ -v _VERSION_ &&
    54             $DKMS install -m _MODULE_ -v _VERSION_ --force
     56        if $DKMS add -m $MODULE -v $VERSION &&
     57            $DKMS build -m $MODULE -v $VERSION &&
     58            $DKMS install -m $MODULE -v $VERSION --force
    5559        then
    5660            exit 0
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