VirtualBox

Changeset 39358 in vbox for trunk/src/VBox/Additions/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.

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

Legend:

Unmodified
Added
Removed
  • 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
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