VirtualBox

Changeset 39358 in vbox for trunk


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.

Location:
trunk/src/VBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r39321 r39358  
    164164 vboxguest-scripts_INST    = $(INST_ADDITIONS)src/
    165165 vboxguest-scripts_MODE    = a+rx,u+w
    166  vboxguest-scripts_SOURCES = $(vboxguest-sh_0_OUTDIR)/do_dkms \
     166 vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/do_dkms \
    167167                             ../../../HostDrivers/linux/build_in_tmp
    168  vboxguest-scripts_CLEAN   = $(vboxguest-sh_0_OUTDIR)/do_dkms
    169168
    170169 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
     
    178177                --output $@ $<
    179178
    180  $$(vboxguest-sh_0_OUTDIR)/do_dkms: \
    181                 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_dkms \
    182                 $(VBOX_VERSION_STAMP) \
    183                 | $$(dir $$@)
    184         $(call MSG_TOOL,Creating,,$@)
    185         $(QUIET)$(SED) \
    186                 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
    187                 -e "s;_MODULE_;vboxguest;g" \
    188                 -e "s;_OLDMODULES_;vboxguest vboxadd vboxsf vboxvfs vboxvideo;g" \
    189                 --output $@ $<
    190         $(QUIET)$(CHMOD) a+rx,u+w $@
    191 
    192179 # scripts.
    193180 INSTALLS += vboxguest-sh
  • trunk/src/VBox/Additions/linux/Makefile.kmk

    r39325 r39358  
    5858VBOX_PATH_LNX_INST_SRC            := $(PATH_ROOT)/src/VBox/Installer/linux/
    5959VBOX_REL_LNX_INST_SRC             := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_INST_SRC))
     60VBOX_PATH_LNX_HOST_DRV            := $(PATH_ROOT)/src/VBox/HostDrivers/linux/
     61VBOX_REL_LNX_HOST_DRV             := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_HOST_DRV))
    6062
    6163# Unset this to speed up things during makefile hacking.
     
    339341        $(VBOX_REL_LNX_ADD_INST)deffiles
    340342LnxAdd-scripts_EXEC_SOURCES  = \
     343        $(VBOX_REL_LNX_HOST_DRV)do_dkms \
    341344        $(VBOX_REL_LNX_INST_SRC)routines.sh \
    342345        $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r39348 r39358  
    2929### END INIT INFO
    3030
    31 . /var/lib/VBoxGuestAdditions/config
    32 export BUILD_TYPE
    33 export USERNAME
    34 
    3531PATH=$PATH:/bin:/sbin:/usr/sbin
    3632PACKAGE=VBoxGuestAdditions
    37 OLDMODULES="vboxguest vboxadd vboxsf vboxvfs vboxvideo"
    38 MODULE_SRC="$INSTALL_DIR/src/vboxguest-$INSTALL_VER"
    39 BUILDINTMP="$MODULE_SRC/build_in_tmp"
    40 DODKMS="$MODULE_SRC/do_dkms"
    4133LOG="/var/log/vboxadd-install.log"
    4234MODPROBE=/sbin/modprobe
     35OLDMODULES="vboxguest vboxadd vboxsf vboxvfs vboxvideo"
    4336
    4437if $MODPROBE -c | grep -q '^allow_unsupported_modules  *0'; then
     
    168161fi
    169162
     163show_error()
     164{
     165    if [ "$system" = "gentoo" ]; then
     166        eerror $1
     167    fi
     168    fail_msg
     169    echo "($1)"
     170}
     171
     172fail()
     173{
     174    show_error "$1"
     175    exit 1
     176}
     177
    170178dev=/dev/vboxguest
    171179userdev=/dev/vboxuser
     180config=/var/lib/VBoxGuestAdditions/config
    172181owner=vboxadd
    173182group=1
     
    199208        printf "The missing package can be probably installed with\napt-get install linux-headers-$KERN_VER\n"
    200209    fi
    201 }
    202 
    203 show_error()
    204 {
    205     if [ "$system" = "gentoo" ]; then
    206         eerror $1
    207     fi
    208     fail_msg
    209     echo "($1)"
    210 }
    211 
    212 fail()
    213 {
    214     show_error "$1"
    215     exit 1
    216210}
    217211
     
    355349{
    356350    begin "Removing existing VirtualBox DKMS kernel modules"
    357     $DODKMS uninstall > $LOG
     351    $DODKMS uninstall $OLDMODULES > $LOG
    358352    succ_msg
    359353    begin "Removing existing VirtualBox non-DKMS kernel modules"
     
    372366
    373367    # Short cut out if a dkms build succeeds
    374     if $DODKMS install >> $LOG 2>&1; then
     368    if $DODKMS install vboxguest $INSTALL_VER >> $LOG 2>&1; then
    375369        succ_msg
    376370        return 0
     
    483477setup()
    484478{
     479    if test -r $config; then
     480      . $config
     481    else
     482      fail "Configuration file $config not found"
     483    fi
     484    test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
     485      fail "Configuration file $config not complete"
     486    export BUILD_TYPE
     487    export USERNAME
     488
     489    MODULE_SRC="$INSTALL_DIR/src/vboxguest-$INSTALL_VER"
     490    BUILDINTMP="$MODULE_SRC/build_in_tmp"
     491    DODKMS="$MODULE_SRC/do_dkms"
     492
    485493    setup_modules
    486494    mod_succ="$?"
     
    498506cleanup()
    499507{
     508    if test -r $config; then
     509      . $config
     510      test -n "$INSTALL_DIR" -a -n "$INSTALL_VER" ||
     511        fail "Configuration file $config not complete"
     512      DODKMS="$INSTALL_DIR/src/vboxguest-$INSTALL_VER/do_dkms"
     513    elif test -x ./do_dkms; then  # Executing as part of the installer...
     514      DODKMS=./do_dkms
     515    else
     516      fail "Configuration file $config not found"
     517    fi
     518
    500519    # Delete old versions of VBox modules.
    501520    cleanup_modules
  • trunk/src/VBox/HostDrivers/Makefile.kmk

    r39333 r39358  
    6767  HostDrivers-scripts_INST    = bin/src/
    6868  HostDrivers-scripts_MODE    = a+rx,u+w
    69   HostDrivers-scripts_SOURCES = $(HostDrivers-scripts_0_OUTDIR)/do_dkms \
     69  HostDrivers-scripts_SOURCES = linux/do_dkms \
    7070                                linux/build_in_tmp
    71   HostDrivers-scripts_CLEAN   = $(HostDrivers-scripts_0_OUTDIR)/do_dkms
    7271
    7372  INSTALLS += HostDrivers-dkms-src
     
    8988                --output $@ $<
    9089
    91 $$(HostDrivers-scripts_0_OUTDIR)/do_dkms: \
    92                 $(PATH_SUB_CURRENT)/linux/do_dkms \
    93                 $(VBOX_VERSION_STAMP) \
    94                 | $$(dir $$@)
    95         $(call MSG_TOOL,Creating,,$@)
    96         $(QUIET)$(SED) \
    97                 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
    98                 -e "s;_MODULE_;vboxhost;g" \
    99                 -e "s;_OLDMODULES_;vboxhost vboxdrv vboxnetflt vboxnetadp;g" \
    100                 --output $@ $<
    101         $(QUIET)$(CHMOD) a+rx,u+w $@
    102 
    10390 endif
    10491
  • 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
  • trunk/src/VBox/Installer/linux/Makefile.kmk

    r39334 r39358  
    339339                -e "s|%DEBIAN%||g" \
    340340                -e "s|%PACKAGE%|virtualbox|g" \
     341                -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
    341342                --output $@ \
    342343                $<
     
    347348                -e "s|%DEBIAN%||g" \
    348349                -e "s|%PACKAGE%|virtualbox|g" \
     350                -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
    349351                -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
    350352                --output $@ \
  • trunk/src/VBox/Installer/linux/debian/rules

    r39223 r39358  
    318318            -e 's|%DEBIAN%|yes|g' \
    319319            -e 's|%PACKAGE%|virtualbox|g' \
     320            -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
    320321            -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
    321322            $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init
  • trunk/src/VBox/Installer/linux/rpm/rules

    r39223 r39358  
    184184           -e 's|%DEBIAN%||g' \
    185185           -e 's|%PACKAGE%|virtualbox|g' \
     186           -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
    186187           -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
    187188           vboxdrv.sh.in > $(archdir)/vboxdrv.init
  • trunk/src/VBox/Installer/linux/vboxdrv.sh.in

    r39334 r39358  
    3232NOLSB=%NOLSB%
    3333DEBIAN=%DEBIAN%
     34VERSION=%VERSION%
    3435MODPROBE=/sbin/modprobe
    3536
     
    299300    stop
    300301    begin_msg "Uninstalling old VirtualBox DKMS kernel modules"
    301     $DODKMS uninstall > $LOG
     302    $DODKMS uninstall vboxhost vboxdrv vboxnetflt vboxnetadp > $LOG
    302303    succ_msg
    303304    if find /lib/modules/`uname -r` -name "vboxpci\.*" 2>/dev/null|grep -q vboxpci; then
     
    322323    fi
    323324    begin_msg "Trying to register the VirtualBox kernel modules using DKMS"
    324     if ! $DODKMS install >> $LOG; then
     325    if ! $DODKMS install vboxhost $VERSION >> $LOG; then
    325326      fail_msg "Failed, trying without DKMS"
    326327      begin_msg "Recompiling VirtualBox kernel modules"
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