VirtualBox

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


Ignore:
Timestamp:
Sep 1, 2010 3:53:42 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65467
Message:

Linux Installer/Additions: attempt to properly register the host/guest kernel modules at DKMS and use the setup function of the service script to compile the modules instead of doing this separately in the installer scripts

Location:
trunk/src/VBox/HostDrivers/linux
Files:
2 added
2 edited

Legend:

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

    r28800 r32183  
    55#
    66#
    7 # Copyright (C) 2008-2009 Oracle Corporation
     7# Copyright (C) 2008-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616#
     17
     18ifneq ($(KBUILD_EXTMOD),)
     19
     20# DKMS
     21
     22obj-m = vboxdrv/
     23ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
     24 obj-m += vboxnetflt/
     25endif
     26ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
     27 obj-m += vboxnetadp/
     28endif
     29
     30else # ! KBUILD_EXTMOD
     31
     32# convenience Makefile without DKMS
    1733
    1834KBUILD_VERBOSE =
     
    7591                fi; \
    7692        done
     93
     94endif # ! KBUILD_EXTMOD
  • trunk/src/VBox/HostDrivers/linux/build_in_tmp

    r28800 r32183  
    33#
    44# Script to build a kernel module in /tmp. Useful if the module sources
    5 # are installed in read-only directory.
     5# are installed in read-only directory. Not for DKMS!
    66#
    7 # Copyright (C) 2007 Oracle Corporation
     7# Copyright (C) 2007-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818# Set the build type
    1919export BUILD_TYPE=_BUILDTYPE_
    20 
    21 # Attempt to build using DKMS first
    22 DKMS=`which dkms 2>/dev/null`
    23 if [ "$1" = "--no-dkms" ]; then
    24   shift
    25   DKMS=""
    26 fi
    27 if [ -n "$DKMS" ]
    28 then
    29     echo "Attempting to install using DKMS"
    30     $DKMS status -m _MODULE_ | while read line
    31     # first, remove _any_ old module
    32     do
    33         if echo "$line" | grep -q added > /dev/null ||
    34            echo "$line" | grep -q built > /dev/null ||
    35            echo "$line" | grep -q installed > /dev/null; then
    36             # either 'vboxvideo, <version>: added' or 'vboxvideo, <version>, ...: installed'
    37             version=`echo "$line" | sed "s/_MODULE_,\([^,]*\)[,:].*/\1/;t;d"`
    38             echo "  removing old DKMS module _MODULE_ version $version"
    39             $DKMS remove -m _MODULE_ -v $version --all
    40         fi
    41     done
    42     # there should not be any more matches
    43     status=`$DKMS status -m _MODULE_ -v _VERSION_`
    44     if echo $status | grep added > /dev/null ||
    45         echo $status | grep built > /dev/null ||
    46         echo $status | grep installed > /dev/null
    47     then
    48         $DKMS remove -m _MODULE_ -v _VERSION_ --all
    49     fi
    50     # finally install the module
    51     if $DKMS add -m _MODULE_ -v _VERSION_ &&
    52         $DKMS build -m _MODULE_ -v _VERSION_ &&
    53         $DKMS install -m _MODULE_ -v _VERSION_ --force
    54     then
    55         exit 0
    56     fi
    57     echo "Failed to install using DKMS, attempting to install without"
    58 fi
    5920
    6021# find a unique temp directory
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