VirtualBox

Changeset 32183 in vbox


Ignore:
Timestamp:
Sep 1, 2010 3:53:42 PM (14 years ago)
Author:
vboxsync
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
Files:
2 added
2 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/postinst.in

    r31999 r32183  
    9393  fi
    9494
    95   # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
    96   REGISTER_DKMS=1
    97   if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    98     db_get virtualbox/module-compilation-allowed
    99     if [ "$RET" = "false" ]; then
    100       cat << EOF
    101 Unable to find a precompiled module for the current kernel
    102 though module compilation denied by debconf setting.
    103 EOF
    104     else
    105       db_input low virtualbox/module-compilation-allowed || true
    106       db_go || true
    107       db_get virtualbox/module-compilation-allowed
    108       if [ "$RET" = "true" ]; then
    109         # Compile module. Don't show a message box here if everything works well.
    110         cat << EOF
    111 Messages emitted during module compilation will be logged to $LOG.
    112 EOF
    113         rm -f /etc/vbox/module_not_compiled
    114         echo "** Compiling vboxdrv" > /var/log/vbox-install.log
    115         if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
    116             --save-module-symvers /tmp/vboxdrv-Module.symvers \
    117             --no-print-directory KBUILD_VERBOSE= \
    118             install >> /var/log/vbox-install.log 2>&1; then
    119           db_fset virtualbox/module-compilation-failed seen false
    120           db_input critical virtualbox/module-compilation-failed || true
    121           db_go || true
    122           touch /etc/vbox/module_not_compiled
    123           # don't abort the installation!
    124         else
    125           echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
    126           if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
    127               --use-module-symvers /tmp/vboxdrv-Module.symvers \
    128               --no-print-directory KBUILD_VERBOSE= \
    129               install >> /var/log/vbox-install.log 2>&1; then
    130             db_fset virtualbox/module-compilation-failed seen false
    131             db_input critical virtualbox/module-compilation-failed || true
    132             db_go || true
    133             touch /etc/vbox/module_not_compiled
    134             # don't abort the installation!
    135           else
    136             echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
    137             if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
    138                 --use-module-symvers /tmp/vboxdrv-Module.symvers \
    139                 --no-print-directory KBUILD_VERBOSE= \
    140                 install >> /var/log/vbox-install.log 2>&1; then
    141               db_fset virtualbox/module-compilation-failed seen false
    142               db_input critical virtualbox/module-compilation-failed || true
    143               db_go || true
    144               touch /etc/vbox/module_not_compiled
    145               # don't abort the installation!
    146             fi
    147           fi
    148         fi
    149         # cleanup
    150         rm -f /tmp/vboxdrv-Module.symvers
    151         if [ ! -f /etc/vbox/module_not_compiled ]; then
    152           # success
    153           cat << EOF
    154 Success!
    155 EOF
    156           REGISTER_DKMS=
    157         fi
    158       fi
    159     fi
    160   fi
    161 
    162   # Register at DKMS. If the modules were built above, they are already registered
    163   if [ -n "$REGISTER_DKMS" ]; then
    164     DKMS=`which dkms 2>/dev/null`
    165     if [ -n "$DKMS" ]; then
    166       for m in vboxdrv vboxnetflt vboxnetadp; do
    167         $DKMS status -m $m | while read line; do
    168           if echo "$line" | grep -q added > /dev/null ||
    169              echo "$line" | grep -q built > /dev/null ||
    170              echo "$line" | grep -q installed > /dev/null; then
    171                v=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
    172                $DKMS remove -m $m -v $v --all > /dev/null 2>&1
    173           fi
    174         done
    175         $DKMS add -m $m -v %VER% > /dev/null 2>&1
    176       done
    177     fi
    178   fi
    179 
    180   # There might be an old module active (e.g. manually loaded)
    181   if lsmod | grep -q "vboxdrv[^_-]"; then
    182     /etc/init.d/vboxdrv stop || true
    183   fi
    184 
    18595  # The starters need to be Suid root. They drop the privileges before starting
    18696  # the real frontend.
     
    212122#DEBHELPER#
    213123
     124if [ "$1" = "configure" ]; then
     125  # Start vboxdrv/vboxweb-service manually as we use our own error handling in postrm
     126  if [ -x "/etc/init.d/vboxdrv" ]; then
     127    update-rc.d vboxdrv defaults >/dev/null
     128
     129    # There might be an old module active (e.g. manually loaded)
     130    if lsmod | grep -q "vboxdrv[^_-]"; then
     131      /etc/init.d/vboxdrv stop || true
     132    fi
     133
     134    BUILD_MODULES=0
     135    # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
     136    if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
     137      db_get virtualbox/module-compilation-allowed
     138      if [ "$RET" = "false" ]; then
     139        cat << EOF
     140Unable to find a precompiled module for the current kernel
     141though module compilation denied by debconf setting.
     142EOF
     143      else
     144        db_input low virtualbox/module-compilation-allowed || true
     145        db_go || true
     146        db_get virtualbox/module-compilation-allowed
     147        if [ "$RET" = "true" ]; then
     148          BUILD_MODULES=1
     149        fi
     150      fi
     151    fi
     152
     153    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     154      if [ $BUILD_MODULES -eq 1 ]; then
     155        invoke-rc.d vboxdrv setup || true
     156      else
     157        invoke-rc.d vboxdrv start || exit $?
     158      fi
     159    else
     160      if [ $BUILD_MODULES -eq 1 ]; then
     161        /etc/init.d/vboxdrv setup || true
     162      else
     163        /etc/init.d/vboxdrv start || exit $?
     164      fi
     165    fi
     166  fi
     167  if [ -x "/etc/init.d/vboxweb-service" ]; then
     168    update-rc.d vboxweb-service defaults >/dev/null
     169#    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     170#        invoke-rc.d vboxweb-service start || exit $?
     171#    else
     172#        /etc/init.d/vboxweb-service start || exit $?
     173#    fi
     174  fi
     175
     176fi # $1 = "configure"
     177
    214178exit 0
  • trunk/debian/prerm.in

    r32030 r32183  
    4444
    4545# make sure we de-register the DMKS modules before the files get removed
    46 DKMS=`which dkms 2>/dev/null`
    47 if [ -n "$DKMS" ]; then
    48   $DKMS remove -m vboxnetadp -v %VER% --all > /dev/null 2>&1 || true
    49   $DKMS remove -m vboxnetflt -v %VER% --all > /dev/null 2>&1 || true
    50   $DKMS remove -m vboxdrv -v %VER% --all > /dev/null 2>&1 || true
     46if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "deconfigure" ]; then
     47  DKMS=`which dkms 2>/dev/null`
     48  if [ -n "$DKMS" ]; then
     49    $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
     50  fi
    5151fi
    5252
  • trunk/debian/rules

    r32045 r32183  
    250250            usr/bin/VBox                        usr/bin/VBoxHeadless \
    251251            $(if $(NOWEBSVC),,usr/bin/VBox      usr/bin/vboxwebsrv) \
    252             usr/share/virtualbox/src/vboxdrv    usr/src/vboxdrv-$(ver) \
    253             usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
    254             usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
     252            usr/share/virtualbox/src/vboxhost   usr/src/vboxhost-$(ver)
    255253        dh_desktop
    256254        dh_installmenu
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r31900 r32183  
    9898 vboxguest-src_MODE     = a+r,u+w
    9999 vboxguest-src_SOURCES  = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
    100  vboxguest-src_SOURCES += $(vboxguest-sh_0_OUTDIR)/dkms.conf
    101  vboxguest-src_CLEAN    = $(vboxguest-sh_0_OUTDIR)/dkms.conf
     100
     101 INSTALLS += vboxguest-dkms-conf
     102 vboxguest-dkms-conf_INST    = $(INST_ADDITIONS)src/
     103 vboxguest-dkms-conf_MODE    = a+r,u+w
     104 vboxguest-dkms-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
     105 vboxguest-dkms-conf_CLEAN   = $(vboxguest-sh_0_OUTDIR)/dkms.conf
     106
     107 INSTALLS += vboxguest-dkms-sh
     108 vboxguest-dkms-sh_INST    = $(INST_ADDITIONS)src/
     109 vboxguest-dkms-sh_MODE    = a+rx,u+w
     110 vboxguest-dkms-sh_SOURCES = $(vboxguest-sh_0_OUTDIR)/do_dkms
     111 vboxguest-dkms-sh_CLEAN   = $(vboxguest-sh_0_OUTDIR)/do_dkms
    102112
    103113 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
     
    106116                | $$(dir $$@)
    107117        $(call MSG_TOOL,Creating,,$@)
    108         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
     118        $(QUIET)$(SED) \
     119                -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
     120                --output $@ $<
     121
     122 $$(vboxguest-sh_0_OUTDIR)/do_dkms: \
     123                $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_dkms \
     124                $(VBOX_VERSION_STAMP) \
     125                | $$(dir $$@)
     126        $(call MSG_TOOL,Creating,,$@)
     127        $(QUIET)$(SED) \
     128                -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
     129                -e "s;_MODULE_;vboxguest;g" \
     130                -e "s;_OLDMODULES_;vboxguest vboxadd vboxsf vboxvfs vboxvideo;g" \
     131                --output $@ $<
    109132
    110133 # scripts.
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile

    r31518 r32183  
    55
    66#
    7 # Copyright (C) 2006-2009 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    222222 endif
    223223 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     224 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxguest,/ /include /r0drv/linux)
    224225 export INCL
    225226endif
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/dkms.conf

    r21118 r32183  
    1 BUILT_MODULE_NAME=vboxguest
    2 DEST_MODULE_LOCATION=/kernel/misc
    3 PACKAGE_NAME=vboxguest
     1## @file
     2# Linux DKMS config script for the VirtualBox guest kernel modules
     3#
     4
     5#
     6# Copyright (C) 2006-2010 Oracle Corporation
     7#
     8# This file is part of VirtualBox Open Source Edition (OSE), as
     9# available from http://www.virtualbox.org. This file is free software;
     10# you can redistribute it and/or modify it under the terms of the GNU
     11# General Public License (GPL) as published by the Free Software
     12# Foundation, in version 2 as it comes in the "COPYING" file of the
     13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     15#
     16
     17PACKAGE_NAME="vboxguest"
    418PACKAGE_VERSION=_VERSION_
    519AUTOINSTALL=yes
    6 POST_BUILD="do_Module.symvers vboxguest save $dkms_tree/$module/$module_version/build/Module.symvers"
     20
     21BUILT_MODULE_NAME[0]="vboxguest"
     22BUILT_MODULE_LOCATION[0]="vboxguest"
     23DEST_MODULE_LOCATION[0]="/kernel/misc"
     24
     25BUILT_MODULE_NAME[1]="vboxsf"
     26BUILT_MODULE_LOCATION[1]="vboxsf"
     27DEST_MODULE_LOCATION[1]="/kernel/misc"
     28
     29BUILT_MODULE_NAME[2]="vboxvideo"
     30BUILT_MODULE_LOCATION[2]="vboxvideo"
     31DEST_MODULE_LOCATION[2]="/kernel/misc"
  • trunk/src/VBox/Additions/linux/Makefile

    r28999 r32183  
    55#
    66#
    7 # Copyright (C) 2009 Oracle Corporation
     7# Copyright (C) 2009-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 = vboxguest/ vboxsf/ vboxvideo/
     23
     24else # ! KBUILD_EXTMOD
    1725
    1826KBUILD_VERBOSE =
     
    6068        @/sbin/insmod vboxguest.ko
    6169        @if [ -f vboxsf.ko ]; then /sbin/insmod vboxsf.ko; fi
     70
     71endif # ! KBUILD_EXTMOD
  • trunk/src/VBox/Additions/linux/Makefile.kmk

    r32166 r32183  
    4242VBOX_LNX_ADD_INST_MOD_DIR         := $(VBOX_LNX_ADD_INST_OUT_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
    4343VBOX_LNX_ADD_INST_KMOD_DIR        := $(VBOX_LNX_ADD_INST_OUT_DIR)src/
     44VBOX_LNX_ADD_INST_KMOD_DIR_MOD    := $(VBOX_LNX_ADD_INST_OUT_DIR)src/vboxguest-$(VBOX_VERSION_STRING)/
    4445VBOX_LNX_ADD_INST_INIT_DIR        := $(VBOX_LNX_ADD_INST_OUT_DIR)init/
    4546
     
    8283        $(VBOX_LNX_ADD_INST_MOD_DIR) \
    8384        $(VBOX_LNX_ADD_INST_KMOD_DIR) \
     85        $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD) \
    8486        $(VBOX_LNX_ADD_INST_INIT_DIR) \
    8587        $(VBOX_LNX_ADD_INST_DBG_DIR) \
     
    155157
    156158VBOX_ADD_KMOD = \
    157         vboxguest
    158 
    159 VBOX_ADD_KMOD.linux = \
    160         vboxsf \
    161         vboxvideo
     159        $(addprefix vboxguest-$(VBOX_VERSION_STRING)/,\
     160                vboxguest vboxsf vboxvideo Makefile dkms.conf do_dkms)
    162161
    163162VBOX_ADD_INIT.linux = \
     
    173172VBOX_LNX_ADD_MOD       = $(VBOX_ADD_MOD) $(VBOX_ADD_MOD.linux)
    174173VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
    175 VBOX_LNX_ADD_KMOD      = $(VBOX_ADD_KMOD) $(VBOX_ADD_KMOD.linux)
     174VBOX_LNX_ADD_KMOD      = $(VBOX_ADD_KMOD)
    176175VBOX_LNX_ADD_INIT      = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
    177 
    178 VBOX_LNX_ADD_KMOD_VERSIONED := $(addsuffix -$(VBOX_VERSION_STRING),$(VBOX_LNX_ADD_KMOD))
    179176
    180177#
     
    189186        $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
    190187        $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
    191         $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_VERSIONED)) \
     188        $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)) \
    192189        $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
    193190        $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
     
    272269
    273270# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
    274 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_VERSIONED)): \
    275                 $(VBOX_LNX_ADD_INST_KMOD_DIR)%-$(VBOX_VERSION_STRING) : $(PATH_BIN)/additions/src/% | $(VBOX_LNX_ADD_INST_KMOD_DIR)
     271$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)): \
     272                $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : $(PATH_BIN)/additions/src/% | $$(dir $$@)
    276273        $(call MSG_INST_DIR,$<,$@)
    277 # Remove target directories first, otherwise the behaviour of cp will not be
    278 # what we want if it already exists. See the cp manual page for more details.
    279274        $(QUIET)$(RM) -Rf $@
    280275        $(QUIET)cp -af $< $@
  • trunk/src/VBox/Additions/linux/drm/Makefile.kmk

    r31900 r32183  
    55
    66#
    7 # Copyright (C) 2006-2007 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434vboxvideo_drm-mod_MODE        = a+r,u+w
    3535vboxvideo_drm-mod_SOURCES     = $(subst ",,$(FILES_VBOXVIDEO_DRM_NOBIN))
    36 vboxvideo_drm-mod_SOURCES    += $(PATH_vboxvideo_drm-mod)/dkms.conf
    37 vboxvideo_drm-mod_CLEAN      += $(PATH_vboxvideo_drm-mod)/dkms.conf
    3836
    3937vboxvideo_drm-sh_INST        = $(INST_ADDITIONS)src/vboxvideo/
     
    8280        $(QUIET)chmod 0755 $@
    8381
    84 $$(PATH_vboxvideo_drm-mod)/dkms.conf: \
    85                 $(PATH_SUB_CURRENT)/dkms.conf \
    86                 $(VBOX_VERSION_STAMP) \
    87                 | $$(dir $$@)
    88         $(call MSG_TOOL,Creating,,$@)
    89         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" < $< > $@
    90 
    9182include $(KBUILD_PATH)/subfooter.kmk
    9283
  • trunk/src/VBox/Additions/linux/drm/Makefile.module

    r28800 r32183  
    44# (For 2.6.x this file must be 'Makefile'!)
    55#
    6 # Copyright (C) 2006-2007 Oracle Corporation
     6# Copyright (C) 2006-2010 Oracle Corporation
    77#
    88# This file is part of VirtualBox Open Source Edition (OSE), as
     
    150150 endif
    151151 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     152 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include /r0drv/linux)
    152153 export INCL
    153154endif
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r31315 r32183  
    55
    66#
    7 # Copyright (C) 2006-2009 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3131PATH=$PATH:/bin:/sbin:/usr/sbin
    3232PACKAGE=VBoxGuestAdditions
    33 BUILDVBOXGUEST=`/bin/ls /usr/src/vboxguest*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
    34 BUILDVBOXSF=`/bin/ls /usr/src/vboxsf*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
    35 BUILDVBOXVIDEO=`/bin/ls /usr/src/vboxvideo*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     33BUILDVBOXGUEST=`/bin/ls /usr/src/vboxguest*/vboxguest/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     34BUILDVBOXSF=`/bin/ls /usr/src/vboxguest*/vboxsf/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     35BUILDVBOXVIDEO=`/bin/ls /usr/src/vboxvideo*/vboxvideo/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     36DODKMS=`/bin/ls /usr/src/vboxguest*/do_dkms 2>/dev/null|cut -d' ' -f1`
    3637LOG="/var/log/vboxadd-install.log"
    3738MODPROBE=/sbin/modprobe
     
    329330{
    330331    # don't stop the old modules here -- they might be in use
     332    begin "Uninstalling old VirtualBox DKMS kernel modules"
     333    $DODKMS uninstall > $LOG
     334    succ_msg
    331335    if find /lib/modules/`uname -r` -name "vboxvideo\.*" 2>/dev/null|grep -q vboxvideo; then
    332336        begin "Removing old VirtualBox vboxvideo kernel module"
     
    346350    begin "Building the VirtualBox Guest Additions kernel modules"
    347351    test_sane_kernel_dir
     352
    348353    if ! sh /usr/share/$PACKAGE/test/build_in_tmp \
    349         --no-dkms --no-print-directory > $LOG 2>&1; then
     354        --no-print-directory >> $LOG 2>&1; then
    350355        fail_msg
    351356        printf "Your system does not seem to be set up to build kernel modules.\nLook at $LOG to find out what went wrong.  Once you have corrected it, you can\nrun\n\n  /etc/init.d/vboxadd setup\n\nto build them."
     
    355360    else
    356361        if ! sh /usr/share/$PACKAGE/test_drm/build_in_tmp \
    357             --no-dkms --no-print-directory >> $LOG 2>&1; then
     362            --no-print-directory >> $LOG 2>&1; then
    358363            printf "\nYour guest system does not seem to have sufficient OpenGL support to enable\naccelerated 3D effects (this requires Linux 2.6.27 or later in the guest\nsystem).  This Guest Additions feature will be disabled.\n\n"
    359364            BUILDVBOXVIDEO=""
     
    361366    fi
    362367    echo
    363     if [ -n "$BUILDVBOXGUEST" ]; then
    364         begin "Building the main Guest Additions module"
    365         if ! $BUILDVBOXGUEST \
    366             --save-module-symvers /tmp/vboxguest-Module.symvers \
    367             --no-print-directory install >> $LOG 2>&1; then
    368             fail "Look at $LOG to find out what went wrong"
    369         fi
    370         succ_msg
    371     fi
    372     if [ -n "$BUILDVBOXSF" ]; then
    373         begin "Building the shared folder support module"
    374         if ! $BUILDVBOXSF \
    375             --use-module-symvers /tmp/vboxguest-Module.symvers \
    376             --no-print-directory install >> $LOG 2>&1; then
    377             fail "Look at $LOG to find out what went wrong"
    378         fi
    379         succ_msg
    380     fi
    381     if [ -n "$BUILDVBOXVIDEO" ]; then
    382         begin "Building the OpenGL support module"
    383         if ! $BUILDVBOXVIDEO \
    384             --use-module-symvers /tmp/vboxguest-Module.symvers \
    385             --no-print-directory install >> $LOG 2>&1; then
    386             fail "Look at $LOG to find out what went wrong"
    387         fi
    388         succ_msg
    389     fi
    390     depmod
     368    if ! $DODKMS install >> $LOG 2>&1; then
     369        if [ -n "$BUILDVBOXGUEST" ]; then
     370            begin "Building the main Guest Additions module"
     371            if ! $BUILDVBOXGUEST \
     372                --save-module-symvers /tmp/vboxguest-Module.symvers \
     373                --no-print-directory install >> $LOG 2>&1; then
     374                fail "Look at $LOG to find out what went wrong"
     375            fi
     376            succ_msg
     377        fi
     378        if [ -n "$BUILDVBOXSF" ]; then
     379            begin "Building the shared folder support module"
     380            if ! $BUILDVBOXSF \
     381                --use-module-symvers /tmp/vboxguest-Module.symvers \
     382                --no-print-directory install >> $LOG 2>&1; then
     383                fail "Look at $LOG to find out what went wrong"
     384            fi
     385            succ_msg
     386        fi
     387        if [ -n "$BUILDVBOXVIDEO" ]; then
     388            begin "Building the OpenGL support module"
     389            if ! $BUILDVBOXVIDEO \
     390                --use-module-symvers /tmp/vboxguest-Module.symvers \
     391                --no-print-directory install >> $LOG 2>&1; then
     392                fail "Look at $LOG to find out what went wrong"
     393            fi
     394            succ_msg
     395        fi
     396        depmod
     397    fi
    391398
    392399    begin "Doing non-kernel setup of the Guest Additions"
  • trunk/src/VBox/Additions/linux/sharedfolders/Makefile.kmk

    r31900 r32183  
    55
    66#
    7 # Copyright (C) 2006-2007 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333vboxsf-mod_MODE        = a+r,u+w
    3434vboxsf-mod_SOURCES     = $(subst ",,$(FILES_VBOXSF_NOBIN))
    35 vboxsf-mod_SOURCES    += $(PATH_vboxsf-mod)/dkms.conf
    36 vboxsf-mod_CLEAN      += $(PATH_vboxsf-mod)/dkms.conf
    3735
    3836vboxsf-sh_INST        = $(INST_ADDITIONS)src/vboxsf/
     
    9997        $(QUIET)chmod 0755 $@
    10098
    101 $$(PATH_vboxsf-mod)/dkms.conf: \
    102                 $(PATH_SUB_CURRENT)/dkms.conf \
    103                 $(VBOX_VERSION_STAMP) \
    104                 | $$(dir $$@)
    105         $(call MSG_TOOL,Creating,,$@)
    106         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
    107 
    10899include $(KBUILD_PATH)/subfooter.kmk
    109100
  • trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module

    r31006 r32183  
    173173 endif
    174174 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     175 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxsf,/ /include /r0drv/linux)
    175176 export INCL
    176177endif
  • trunk/src/VBox/HostDrivers/Makefile.kmk

    r28800 r32183  
    55
    66#
    7 # Copyright (C) 2006-2007 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    4545  #
    4646  INSTALLS += HostDrivers-src
    47   HostDrivers-src_INST    = bin/src/
    48   HostDrivers-src_MODE    = a+r,u+w
    49   HostDrivers-src_SOURCES.linux = linux/Makefile
     47  HostDrivers-src_INST            = bin/src/
     48  HostDrivers-src_MODE            = a+r,u+w
     49  HostDrivers-src_SOURCES.linux   = linux/Makefile
    5050  HostDrivers-src_SOURCES.freebsd = freebsd/Makefile
     51 endif
     52
     53 if1of ($(KBUILD_TARGET),linux)
     54  INSTALLS += HostDrivers-dkms-sh
     55  HostDrivers-dkms-sh_INST    = bin/src/
     56  HostDrivers-dkms-sh_MODE    = a+rx,u+w
     57  HostDrivers-dkms-sh_SOURCES = $(PATH_HostDrivers-dkms-sh)/do_dkms
     58  HostDrivers-dkms-sh_CLEAN   = $(PATH_HostDrviers-dkms-sh)/do_dkms
     59
     60  INSTALLS += HostDrivers-dkms-src
     61  HostDrivers-dkms-src_INST    = bin/src/
     62  HostDrivers-dkms-src_MODE    = a+r,u+w
     63  HostDrivers-dkms-src_SOURCES = $(PATH_HostDrivers-dkms-src)/dkms.conf
     64  HostDrivers-dkms-src_CLEAN   = $(PATH_HostDrivers-dkms-src)/dkms.conf
    5165 endif
    5266
     
    6276endif # !defined(VBOX_ONLY_DOCS) && !defined(VBOX_ONLY_TESTSUITE)
    6377
     78# Scripts needed for building the kernel modules
     79
     80$$(PATH_HostDrivers-dkms-src)/dkms.conf: \
     81                $(PATH_SUB_CURRENT)/linux/dkms.conf \
     82                $(VBOX_VERSION_STAMP) \
     83                | $$(dir $$@)
     84        $(call MSG_TOOL,Creating,,$@)
     85        $(QUIET)$(SED) \
     86                -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
     87                -e "s;_OMIT_VBOXNETFLT_;$(if $(VBOX_WITH_NETFLT),,#);g" \
     88                -e "s;_OMIT_VBOXNETADP_;$(if $(VBOX_WITH_NETADP),,#);g" \
     89                --output $@ $<
     90
     91$$(PATH_HostDrivers-dkms-sh)/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
    64102# Let kBuild generate the rules.
    65103include $(KBUILD_PATH)/subfooter.kmk
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r31900 r32183  
    4949  SYSMODS.solaris += vboxdrv
    5050 endif
    51  INSTALLS.linux   += vboxdrv-mod vboxdrv-sh
     51 INSTALLS.linux   += vboxdrv-mod vboxdrv-sh vboxdrv-dkms
    5252 INSTALLS.freebsd += vboxdrv-mod vboxdrv-sh
    5353
     
    260260vboxdrv-mod_SOURCES = $(subst ",,$(FILES_VBOXDRV_NOBIN)) #"
    261261vboxdrv-mod_SOURCES += \
    262         $(PATH_vboxdrv-mod)/dkms.conf \
    263262        $(PATH_vboxdrv-mod)/Makefile
    264263vboxdrv-mod_CLEAN   = \
    265         $(PATH_vboxdrv-mod)/dkms.conf \
    266264        $(PATH_vboxdrv-mod)/Makefile
    267265
     
    276274        $(PATH_vboxdrv-sh)/build_in_tmp
    277275
    278 
    279276# Scripts needed for building the kernel modules
    280277
     
    284281                | $$(dir $$@)
    285282        $(call MSG_TOOL,Creating,,$@)
    286         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxdrv;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
     283        $(QUIET)$(SED) \
     284                -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
     285                -e "s;_MODULE_;vboxdrv;g" \
     286                -e "s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
    287287        $(QUIET)chmod 0755 $@
    288 
    289 $$(PATH_vboxdrv-mod)/dkms.conf: \
    290                 $(PATH_SUB_CURRENT)/linux/dkms.conf \
    291                 $(VBOX_VERSION_STAMP) \
    292                 | $$(dir $$@)
    293         $(call MSG_TOOL,Creating,,$@)
    294         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
    295288
    296289includedep $(PATH_TARGET)/vboxdrv-sh-1.dep
     
    309302
    310303endif # real linux
    311 
    312304
    313305
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r31829 r32183  
    228228 endif
    229229 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     230 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxdrv,/ /include /r0drv/linux)
    230231 export INCL
    231232endif
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk

    r31900 r32183  
    55
    66#
    7 # Copyright (C) 2009 Oracle Corporation
     7# Copyright (C) 2009-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    103103 VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
    104104 VBoxNetAdp-src_SOURCES+= \
    105         $(PATH_VBoxNetAdp-src)/dkms.conf \
    106105        $(PATH_VBoxNetAdp-src)/Makefile
    107106 VBoxNetAdp-src_CLEAN   = \
    108         $(PATH_VBoxNetAdp-src)/dkms.conf \
    109107        $(PATH_VBoxNetAdp-src)/Makefile \
    110108        $(PATH_TARGET)/VBoxNetAdp-src-1.dep
     
    141139        $(QUIET)chmod 0755 $@
    142140
    143 $$(PATH_VBoxNetAdp-src)/dkms.conf: \
    144                 $(PATH_SUB_CURRENT)/linux/dkms.conf \
    145                 $(VBOX_VERSION_STAMP) \
    146                 | $$(dir $$@)
    147         $(call MSG_TOOL,Creating,,$@)
    148         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
    149 
    150141endif # linux
    151142
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile

    r31245 r32183  
    66#
    77#
    8 # Copyright (C) 2006-2007 Oracle Corporation
     8# Copyright (C) 2006-2010 Oracle Corporation
    99#
    1010# This file is part of VirtualBox Open Source Edition (OSE), as
     
    157157 endif
    158158 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     159 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxnetadp,/ /include /r0drv/linux)
    159160 export INCL
    160161endif
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk

    r31900 r32183  
    55
    66#
    7 # Copyright (C) 2008 Oracle Corporation
     7# Copyright (C) 2008-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    367367 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
    368368 VBoxNetFlt-src_SOURCES+= \
    369         $(PATH_VBoxNetFlt-src)/dkms.conf \
    370369        $(PATH_VBoxNetFlt-src)/Makefile
    371370 VBoxNetFlt-src_CLEAN   = \
    372         $(PATH_VBoxNetFlt-src)/dkms.conf \
    373371        $(PATH_VBoxNetFlt-src)/Makefile \
    374372        $(PATH_TARGET)/VBoxNetFlt-src-1.dep
     
    403401        $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetflt;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
    404402        $(QUIET)chmod 0755 $@
    405 
    406  # Script needed for building the kernel module
    407  $$(PATH_VBoxNetFlt-src)/dkms.conf: \
    408                 $(PATH_SUB_CURRENT)/linux/dkms.conf \
    409                 $(VBOX_VERSION_STAMP) \
    410                 | $$(dir $$@)
    411         $(call MSG_TOOL,Creating,,$@)
    412         $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
    413403
    414404endif # linux
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile

    r31245 r32183  
    66#
    77#
    8 # Copyright (C) 2006-2007 Oracle Corporation
     8# Copyright (C) 2006-2010 Oracle Corporation
    99#
    1010# This file is part of VirtualBox Open Source Edition (OSE), as
     
    161161 endif
    162162 INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     163 INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxnetflt,/ /include /r0drv/linux)
    163164 export INCL
    164165endif
  • 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
  • trunk/src/VBox/Installer/linux/Makefile.kmk

    r31768 r32183  
    55
    66#
    7 # Copyright (C) 2006-2007 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    146146        VBoxSysInfo.sh \
    147147        VBox.sh \
    148         VBox.png \
    149         src
     148        VBox.png
    150149
    151150# Qt4 GUI
     
    254253# All the bin files that goes into the archives.
    255254#
    256 VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
     255VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
    257256
    258257# Cleanup of the files we copy/symlink from bin.
     
    382381endif
    383382
     383# special rule for the kernel modules
     384$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_BIN)/src | $(dir $@)
     385        $(call MSG_INST_SYM,$<,$@)
     386        $(QUIET)$(RM) -Rf $@
     387        $(QUIET)$(MKDIR) $@
     388        $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
     389
    384390# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
    385391$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r32008 r32183  
    9393  fi
    9494
    95   # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
    96   REGISTER_DKMS=1
    97   if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    98     db_get virtualbox/module-compilation-allowed
    99     if [ "$RET" = "false" ]; then
    100       cat << EOF
    101 Unable to find a precompiled module for the current kernel
    102 though module compilation denied by debconf setting.
    103 EOF
    104     else
    105       db_input low virtualbox/module-compilation-allowed || true
    106       db_go || true
    107       db_get virtualbox/module-compilation-allowed
    108       if [ "$RET" = "true" ]; then
    109         # Compile module. Don't show a message box here if everything works well.
    110         cat << EOF
    111 Messages emitted during module compilation will be logged to $LOG.
    112 EOF
    113         rm -f /etc/vbox/module_not_compiled
    114         echo "** Compiling vboxdrv" > /var/log/vbox-install.log
    115         if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
    116             --save-module-symvers /tmp/vboxdrv-Module.symvers \
    117             --no-print-directory KBUILD_VERBOSE= \
    118             install >> /var/log/vbox-install.log 2>&1; then
    119           db_fset virtualbox/module-compilation-failed seen false
    120           db_input critical virtualbox/module-compilation-failed || true
    121           db_go || true
    122           touch /etc/vbox/module_not_compiled
    123           # don't abort the installation!
    124         else
    125           echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
    126           if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
    127               --use-module-symvers /tmp/vboxdrv-Module.symvers \
    128               --no-print-directory KBUILD_VERBOSE= \
    129               install >> /var/log/vbox-install.log 2>&1; then
    130             db_fset virtualbox/module-compilation-failed seen false
    131             db_input critical virtualbox/module-compilation-failed || true
    132             db_go || true
    133             touch /etc/vbox/module_not_compiled
    134             # don't abort the installation!
    135           else
    136             echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
    137             if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
    138                 --use-module-symvers /tmp/vboxdrv-Module.symvers \
    139                 --no-print-directory KBUILD_VERBOSE= \
    140                 install >> /var/log/vbox-install.log 2>&1; then
    141               db_fset virtualbox/module-compilation-failed seen false
    142               db_input critical virtualbox/module-compilation-failed || true
    143               db_go || true
    144               touch /etc/vbox/module_not_compiled
    145               # don't abort the installation!
    146             fi
    147           fi
    148         fi
    149         # cleanup
    150         rm -f /tmp/vboxdrv-Module.symvers
    151         if [ ! -f /etc/vbox/module_not_compiled ]; then
    152           # success
    153           cat << EOF
    154 Success!
    155 EOF
    156           REGISTER_DKMS=
    157         fi
    158       fi
    159     fi
    160   fi
    161 
    162   # Register at DKMS. If the modules were built above, they are already registered
    163   if [ -n "$REGISTER_DKMS" ]; then
    164     DKMS=`which dkms 2>/dev/null`
    165     if [ -n "$DKMS" ]; then
    166       for m in vboxdrv vboxnetflt vboxnetadp; do
    167         $DKMS status -m $m | while read line; do
    168           if echo "$line" | grep -q added > /dev/null ||
    169              echo "$line" | grep -q built > /dev/null ||
    170              echo "$line" | grep -q installed > /dev/null; then
    171                v=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
    172                $DKMS remove -m $m -v $v --all > /dev/null 2>&1
    173           fi
    174         done
    175         $DKMS add -m $m -v %VER% > /dev/null 2>&1
    176       done
    177     fi
    178   fi
    179 
    180   # There might be an old module active (e.g. manually loaded)
    181   if lsmod | grep -q "vboxdrv[^_-]"; then
    182     /etc/init.d/vboxdrv stop || true
    183   fi
    184 
    18595  # The starters need to be Suid root. They drop the privileges before starting
    18696  # the real frontend.
     
    216126  if [ -x "/etc/init.d/vboxdrv" ]; then
    217127    update-rc.d vboxdrv defaults >/dev/null
     128
     129    # There might be an old module active (e.g. manually loaded)
     130    if lsmod | grep -q "vboxdrv[^_-]"; then
     131      /etc/init.d/vboxdrv stop || true
     132    fi
     133
     134    BUILD_MODULES=0
     135    # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
     136    if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
     137      db_get virtualbox/module-compilation-allowed
     138      if [ "$RET" = "false" ]; then
     139        cat << EOF
     140Unable to find a precompiled module for the current kernel
     141though module compilation denied by debconf setting.
     142EOF
     143      else
     144        db_input low virtualbox/module-compilation-allowed || true
     145        db_go || true
     146        db_get virtualbox/module-compilation-allowed
     147        if [ "$RET" = "true" ]; then
     148          BUILD_MODULES=1
     149        fi
     150      fi
     151    fi
     152
    218153    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     154      if [ $BUILD_MODULES -eq 1 ]; then
     155        invoke-rc.d vboxdrv setup || true
     156      else
    219157        invoke-rc.d vboxdrv start || exit $?
     158      fi
    220159    else
     160      if [ $BUILD_MODULES -eq 1 ]; then
     161        /etc/init.d/vboxdrv setup || true
     162      else
    221163        /etc/init.d/vboxdrv start || exit $?
     164      fi
    222165    fi
    223166  fi
     
    230173#    fi
    231174  fi
    232 fi
     175
     176fi # $1 = "configure"
    233177
    234178exit 0
  • trunk/src/VBox/Installer/linux/debian/prerm.in

    r32008 r32183  
    4444
    4545# make sure we de-register the DMKS modules before the files get removed
    46 DKMS=`which dkms 2>/dev/null`
    47 if [ -n "$DKMS" ]; then
    48   $DKMS remove -m vboxnetadp -v %VER% --all > /dev/null 2>&1 || true
    49   $DKMS remove -m vboxnetflt -v %VER% --all > /dev/null 2>&1 || true
    50   $DKMS remove -m vboxdrv -v %VER% --all > /dev/null 2>&1 || true
     46if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "deconfigure" ]; then
     47  DKMS=`which dkms 2>/dev/null`
     48  if [ -n "$DKMS" ]; then
     49    $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
     50  fi
    5151fi
    5252
  • trunk/src/VBox/Installer/linux/debian/rules

    r32044 r32183  
    278278            usr/bin/VBox                        usr/bin/VBoxHeadless \
    279279            $(if $(NOWEBSVC),,usr/bin/VBox      usr/bin/vboxwebsrv) \
    280             usr/share/virtualbox/src/vboxdrv    usr/src/vboxdrv-$(ver) \
    281             usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
    282             usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
     280            usr/share/virtualbox/src/vboxhost   usr/src/vboxhost-$(ver)
    283281        dh_desktop
    284282        dh_installmenu
  • trunk/src/VBox/Installer/linux/install.sh

    r31768 r32183  
    6565
    6666module_loaded() {
    67     lsmod | grep -q vboxdrv
     67    lsmod | grep -q "vboxdrv[^_-]"
    6868}
    6969
     
    268268            if [ -n "$DKMS" ]
    269269            then
     270                $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
    270271                $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1
    271272                $DKMS remove -m vboxnetflt -v $INSTALL_VER --all > /dev/null 2>&1
     
    382383    ln -sf $INSTALLATION_DIR/virtualbox.desktop /usr/share/applications/virtualbox.desktop
    383384    ln -sf $INSTALLATION_DIR/rdesktop-vrdp /usr/bin/rdesktop-vrdp
    384     ln -sf $INSTALLATION_DIR/src/vboxdrv /usr/src/vboxdrv-_VERSION_
    385     ln -sf $INSTALLATION_DIR/src/vboxnetflt /usr/src/vboxnetflt-_VERSION_
    386     ln -sf $INSTALLATION_DIR/src/vboxnetadp /usr/src/vboxnetadp-_VERSION_
     385    ln -sf $INSTALLATION_DIR/src/vboxhost /usr/src/vboxhost-_VERSION_
    387386
    388387    # If Python is available, install Python bindings
     
    432431    udevplug -Busb > /dev/null 2>&1
    433432
     433    # Write the configuration. Do this before we call /etc/init.d/vboxdrv setup!
     434    echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
     435    echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
     436    echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
     437    echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
     438    echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
     439
    434440    # Make kernel module
    435441    MODULE_FAILED="false"
    436442    if [ "$BUILD_MODULE" = "true" ]
    437443    then
    438         info "Building the VirtualBox vboxdrv kernel module"
     444        info "Building the VirtualBox kernel modules"
    439445        log "Output from the module build process (the Linux kernel build system) follows:"
    440446        cur=`pwd`
    441447        log ""
    442         cd $INSTALLATION_DIR/src/vboxdrv
    443         ./build_in_tmp \
    444           --save-module-symvers /tmp/vboxdrv-Module.symvers \
    445           --no-print-directory install >> $LOG 2>&1
    446         RETVAL=$?
    447         if [ $RETVAL -ne 0 ]
    448         then
    449             info "Failed to build the vboxdrv kernel module."
    450             info "Please check the log file $LOG for more information."
    451             MODULE_FAILED="true"
    452             RC_SCRIPT=1
    453         else
    454             info "Building the VirtualBox netflt kernel module"
    455             log "Output from the module build process (the Linux kernel build system) follows:"
    456             cd $INSTALLATION_DIR/src/vboxnetflt
    457             ./build_in_tmp \
    458               --use-module-symvers /tmp/vboxdrv-Module.symvers \
    459               --no-print-directory install >> $LOG 2>&1
    460             RETVAL=$?
    461             if [ $RETVAL -ne 0 ]
    462             then
    463                 info "Failed to build the vboxnetflt kernel module."
    464                 info "Please check the log file $LOG for more information."
    465                 MODULE_FAILED="true"
    466                 RC_SCRIPT=1
    467             else
    468                 info "Building the VirtualBox netadp kernel module"
    469                 log "Output from the module build process (the Linux kernel build system) follows:"
    470                 cd $INSTALLATION_DIR/src/vboxnetadp
    471                 ./build_in_tmp \
    472                     --use-module-symvers /tmp/vboxdrv-Module.symvers \
    473                     --no-print-directory install >> $LOG 2>&1
    474                 RETVAL=$?
    475                 if [ $RETVAL -ne 0 ]
    476                 then
    477                     info "Failed to build the vboxnetadp kernel module."
    478                     info "Please check the log file $LOG for more information."
    479                     MODULE_FAILED="true"
    480                     RC_SCRIPT=1
    481                 fi
    482             fi
    483         fi
    484         # cleanup
    485         rm -f /tmp/vboxdrv-Module.symvers
     448        setup_init_script vboxdrv
    486449        # Start VirtualBox kernel module
    487450        if [ $RETVAL -eq 0 ] && ! start_init_script vboxdrv; then
     
    495458    fi
    496459
    497     echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
    498     echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
    499     echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
    500     echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
    501     echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
    502460    info ""
    503461    if [ ! "$MODULE_FAILED" = "true" ]
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r32008 r32183  
    135135ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxHeadless
    136136ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxwebsrv
    137 ln -s /usr/share/virtualbox/src/vboxdrv $RPM_BUILD_ROOT/usr/src/vboxdrv-%VER%
    138 ln -s /usr/share/virtualbox/src/vboxnetflt $RPM_BUILD_ROOT/usr/src/vboxnetflt-%VER%
    139 ln -s /usr/share/virtualbox/src/vboxnetadp $RPM_BUILD_ROOT/usr/src/vboxnetadp-%VER%
     137ln -s /usr/share/virtualbox/src/vboxhost $RPM_BUILD_ROOT/usr/src/vboxhost-%VER%
    140138mv virtualbox.desktop $RPM_BUILD_ROOT/usr/share/applications/virtualbox.desktop
    141139mv VBox.png $RPM_BUILD_ROOT/usr/share/pixmaps/VBox.png
     
    267265%endif
    268266
    269 # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
    270 REGISTER_DKMS=1
     267# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
     268BUILD_MODULES=0
    271269if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    272270  # compile problem
     
    276274
    277275EOF
    278   rm -f /etc/vbox/module_not_compiled
    279   echo "** Compiling vboxdrv" > /var/log/vbox-install.log
    280   if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
    281     --save-module-symvers /tmp/vboxdrv-Module.symvers \
    282     --no-print-directory KBUILD_VERBOSE= \
    283     install >> /var/log/vbox-install.log 2>&1; then
    284     cat << EOF
    285 Compilation of the kernel module FAILED! VirtualBox will not start until this
    286 problem is fixed. Please consult $LOG to find out why the
    287 kernel module does not compile. Most probably the kernel sources are not found.
    288 Install them and execute
    289 
    290   /etc/init.d/vboxdrv setup
    291 
    292 as root.
    293 
    294 EOF
    295     touch /etc/vbox/module_not_compiled
    296   else
    297     echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
    298     if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
    299       --use-module-symvers /tmp/vboxdrv-Module.symvers \
    300       --no-print-directory KBUILD_VERBOSE= \
    301       install >> /var/log/vbox-install.log 2>&1; then
    302       cat << EOF
    303 Compilation of the kernel module FAILED! VirtualBox will not start until this
    304 problem is fixed. Please consult $LOG to find out why the
    305 kernel module does not compile. Most probably the kernel sources are not found.
    306 Install them and execute
    307 
    308   /etc/init.d/vboxdrv setup
    309 
    310 as root.
    311 
    312 EOF
    313       touch /etc/vbox/module_not_compiled
    314     else
    315       echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
    316       if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
    317         --use-module-symvers /tmp/vboxdrv-Module.symvers \
    318         --no-print-directory KBUILD_VERBOSE= \
    319         install >> /var/log/vbox-install.log 2>&1; then
    320         cat << EOF
    321 Compilation of the kernel module FAILED! VirtualBox will not start until this
    322 problem is fixed. Please consult $LOG to find out why the
    323 kernel module does not compile. Most probably the kernel sources are not found.
    324 Install them and execute
    325 
    326   /etc/init.d/vboxdrv setup
    327 
    328 as root.
    329 
    330 EOF
    331         touch /etc/vbox/module_not_compiled
    332       fi
    333     fi
    334   fi
    335   rm -f /tmp/vboxdrv-Module.symvers
    336   if [ ! -f /etc/vbox/module_not_compiled ]; then
    337     cat << EOF
    338 Success!
    339 
    340 EOF
    341     REGISTER_DKMS=
    342   fi
    343 fi
    344 # Register at DKMS. If the modules were built above, they are already registered
    345 if [ -n "$REGISTER_DKMS" ]; then
    346   DKMS=`which dkms 2>/dev/null`
    347   if [ -n "$DKMS" ]; then
    348     for m in vboxdrv vboxnetflt vboxnetadp; do
    349       $DKMS status -m $m | while read line; do
    350         if echo "$line" | grep -q added > /dev/null ||
    351            echo "$line" | grep -q built > /dev/null ||
    352            echo "$line" | grep -q installed > /dev/null; then
    353              v=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
    354              $DKMS remove -m $m -v $v --all > /dev/null 2>&1
    355         fi
    356       done
    357       $DKMS add -m $m -v %VER% > /dev/null 2>&1
    358     done
    359   fi
     276  BUILD_MODULES=1
    360277fi
    361278# if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
     
    368285  /etc/init.d/vboxdrv stop || true
    369286fi
    370 if [ ! -f /etc/vbox/module_not_compiled ]; then
    371   depmod -a
     287if [ $BUILD_MODULES -eq 1 ]; then
     288  /etc/init.d/vboxdrv setup || true
     289else
    372290  /etc/init.d/vboxdrv start > /dev/null
    373   /etc/init.d/vboxweb-service start > /dev/null
    374 fi
     291fi
     292/etc/init.d/vboxweb-service start > /dev/null
    375293
    376294
     
    405323DKMS=`which dkms 2>/dev/null`
    406324if [ -n "$DKMS" ]; then
    407   $DKMS remove -m vboxnetadp -v %VER% --all > /dev/null 2>&1 || true
    408   $DKMS remove -m vboxnetflt -v %VER% --all > /dev/null 2>&1 || true
    409   $DKMS remove -m vboxdrv -v %VER% --all > /dev/null 2>&1 || true
     325  $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
    410326fi
    411327
  • trunk/src/VBox/Installer/linux/uninstall.sh

    r31768 r32183  
    11#!/bin/sh
     2#
     3# Oracle VM VirtualBox
     4# VirtualBox linux uninstallation script
     5
     6#
     7# Copyright (C) 2009-2010 Oracle Corporation
     8#
     9# This file is part of VirtualBox Open Source Edition (OSE), as
     10# available from http://www.virtualbox.org. This file is free software;
     11# you can redistribute it and/or modify it under the terms of the GNU
     12# General Public License (GPL) as published by the Free Software
     13# Foundation, in version 2 as it comes in the "COPYING" file of the
     14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16#
    217
    318. `dirname $0`/routines.sh
     
    4964# Remove kernel module installed
    5065if [ -n "$DKMS" ]; then
    51     $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1
     66    $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
    5267fi
    5368if [ -z "$VBOX_DONT_REMOVE_OLD_MODULES" ]; then
     
    5873    find /lib/modules/`uname -r` -name vbox\* 2>/dev/null|xargs rmdir -p 2> /dev/null
    5974    find /lib/modules/`uname -r` -name misc\* 2>/dev/null|xargs rmdir -p 2> /dev/null
     75    rm -f /usr/src/vboxhost-$INSTALL_VER 2> /dev/null
    6076    rm -f /usr/src/vboxdrv-$INSTALL_VER 2> /dev/null
    6177    rm -f /usr/src/vboxnetflt-$INSTALL_VER 2> /dev/null
  • trunk/src/VBox/Installer/linux/vboxdrv.sh.in

    r29657 r32183  
    4444if [ -n "$INSTALL_DIR" ]; then
    4545    VBOXMANAGE="$INSTALL_DIR/VBoxManage"
    46     BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
    47     BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
    48     BUILDVBOXNETADP="$INSTALL_DIR/src/vboxnetadp/build_in_tmp"
     46    DODKMS="$INSTALL_DIR/src/vboxhost/do_dkms"
     47    BUILDVBOXDRV="$INSTALL_DIR/src/vboxhost/vboxdrv/build_in_tmp"
     48    BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxhost/vboxnetflt/build_in_tmp"
     49    BUILDVBOXNETADP="$INSTALL_DIR/src/vboxhost/vboxnetadp/build_in_tmp"
    4950else
    5051    VBOXMANAGE="/usr/lib/%PACKAGE%/VBoxManage"
    51     BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxdrv/build_in_tmp"
    52     BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxnetflt/build_in_tmp"
    53     BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxnetadp/build_in_tmp"
     52    DODKMS="/usr/share/%PACKAGE%/src/vboxhost/do_dkms"
     53    BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxhost/vboxdrv/build_in_tmp"
     54    BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxhost/vboxnetflt/build_in_tmp"
     55    BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxhost/vboxnetadp/build_in_tmp"
    5456fi
    5557
     
    280282}
    281283
     284# setup_script
    282285setup()
    283286{
    284287    stop
     288    begin_msg "Uninstalling old VirtualBox DKMS kernel modules"
     289    $DODKMS uninstall > $LOG
     290    succ_msg
    285291    if find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|grep -q vboxnetadp; then
    286292        begin_msg "Removing old VirtualBox netadp kernel module"
     
    298304        succ_msg
    299305    fi
    300     begin_msg "Recompiling VirtualBox kernel module"
    301     if ! $BUILDVBOXDRV \
    302         --save-module-symvers /tmp/vboxdrv-Module.symvers \
    303         --no-print-directory install > $LOG 2>&1; then
    304         failure "Look at $LOG to find out what went wrong"
    305     fi
    306     if ! $BUILDVBOXNETFLT \
    307         --use-module-symvers /tmp/vboxdrv-Module.symvers \
     306    begin_msg "Trying to register the VirtualBox kernel modules using DKMS"
     307    if ! $DODKMS install >> $LOG; then
     308      fail_msg "Failed, trying without DKMS"
     309      begin_msg "Recompiling VirtualBox kernel module"
     310      if ! $BUILDVBOXDRV \
     311          --save-module-symvers /tmp/vboxdrv-Module.symvers \
     312          --no-print-directory install >> $LOG 2>&1; then
     313          failure "Look at $LOG to find out what went wrong"
     314      fi
     315      if ! $BUILDVBOXNETFLT \
     316          --use-module-symvers /tmp/vboxdrv-Module.symvers \
     317          --no-print-directory install >> $LOG 2>&1; then
     318          failure "Look at $LOG to find out what went wrong"
     319      fi
     320      if ! $BUILDVBOXNETADP \
     321          --use-module-symvers /tmp/vboxdrv-Module.symvers \
    308322        --no-print-directory install >> $LOG 2>&1; then
    309         failure "Look at $LOG to find out what went wrong"
    310     fi
    311     if ! $BUILDVBOXNETADP \
    312         --use-module-symvers /tmp/vboxdrv-Module.symvers \
    313         --no-print-directory install >> $LOG 2>&1; then
    314         failure "Look at $LOG to find out what went wrong"
     323          failure "Look at $LOG to find out what went wrong"
     324      fi
    315325    fi
    316326    rm -f /etc/vbox/module_not_compiled
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