VirtualBox

Changeset 14256 in vbox for trunk


Ignore:
Timestamp:
Nov 17, 2008 3:27:53 PM (16 years ago)
Author:
vboxsync
Message:

Linux installer: added vboxnetflt support

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/Makefile.kmk

    r14015 r14256  
    250250# files that needs editing before they can be included in the generic installer.
    251251$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
    252         $(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g; s|%PACKAGE%|virtualbox|g"  --output $@ $<
     252        $(QUIET)$(SED_EXT) \
     253                -e "s|%NOLSB%|yes|g" \
     254                -e "s|%NETFLT%|$(VBOX_WITH_NETFLT)|g" \
     255                -e "s|%PACKAGE%|virtualbox|g" \
     256                --output $@ \
     257                $<
    253258
    254259$(VBOX_LNX_INST_OUT_DIR)/vboxnet.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxnet.sh.in | $$(dir $$@)
  • trunk/src/VBox/Installer/linux/vboxdrv.sh.in

    r14016 r14256  
    2929PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
    3030DEVICE=/dev/vboxdrv
    31 MODNAME=vboxdrv
    3231GROUPNAME=vboxusers
    3332LOG="/var/log/vbox-install.log"
    3433NOLSB=%NOLSB%
     34NETFLT=%NETFLT%
    3535
    3636[ -f /lib/lsb/init-functions ] || NOLSB=yes
     
    3939if [ -n "$INSTALL_DIR" ]; then
    4040    VBOXMANAGE="$INSTALL_DIR/VBoxManage"
    41     BUILDINTMP="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
     41    BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
     42    BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
    4243else
    4344    VBOXMANAGE="/usr/lib/%PACKAGE%/VBoxManage"
    44     BUILDINTMP="/usr/share/%PACKAGE%/src/vboxdrv/build_in_tmp"
     45    BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxdrv/build_in_tmp"
     46    BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxnetflt/build_in_tmp"
    4547fi
    4648
     
    137139running()
    138140{
    139     lsmod | grep -q "$MODNAME[^_-]"
     141    lsmod | grep -q "$1[^_-]"
    140142}
    141143
     
    143145{
    144146    begin_msg "Starting VirtualBox kernel module"
    145     if ! running; then
     147    if ! running vboxdrv; then
    146148        if ! find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
    147149            failure "No suitable module for running kernel found"
     
    150152            failure "Cannot remove $DEVICE"
    151153        fi
    152         if ! modprobe $MODNAME > /dev/null 2>&1; then
    153             failure "modprobe $MODNAME failed. Please use 'dmesg' to find out why"
     154        if ! modprobe vboxdrv > /dev/null 2>&1; then
     155            failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
    154156        fi
    155157        sleep .2
     
    167169        fi
    168170        if [ -z "$MAJOR" ]; then
    169             rmmod $MODNAME 2>/dev/null
     171            rmmod vboxdrv 2>/dev/null
    170172            failure "Cannot locate the VirtualBox device"
    171173        fi
    172174        if ! mknod -m 0660 $DEVICE c $MAJOR $MINOR 2>/dev/null; then
    173             rmmod $MODNAME 2>/dev/null
     175            rmmod vboxdrv 2>/dev/null
    174176            failure "Cannot create device $DEVICE with major $MAJOR and minor $MINOR"
    175177        fi
     
    177179    # ensure permissions
    178180    if ! chown :$GROUPNAME $DEVICE 2>/dev/null; then
    179         rmmod $MODNAME 2>/dev/null
     181        rmmod vboxnetflt 2>/dev/null
     182        rmmod vboxdrv 2>/dev/null
    180183        failure "Cannot change owner $GROUPNAME for device $DEVICE"
    181184    fi
     185    if [ -n "$NETFLT" ]; then
     186        if ! modprobe vboxnetflt > /dev/null 2>&1; then
     187            failure "modprobe vboxnetflt failed. Please use 'dmesg' to find out why"
     188        fi
     189    fi
    182190    succ_msg
    183191}
     
    186194{
    187195    begin_msg "Stopping VirtualBox kernel module"
    188     if running; then
    189         if ! rmmod $MODNAME 2>/dev/null; then
    190             failure "Cannot unload module $MODNAME"
     196    if running vboxdrv; then
     197        if running vboxnetflt; then
     198            if ! rmmod vboxnetflt 2>/dev/null; then
     199                failure "Cannot unload module vboxnetflt"
     200            fi
     201        fi
     202        if ! rmmod vboxdrv 2>/dev/null; then
     203            failure "Cannot unload module vboxdrv"
    191204        fi
    192205        if ! rm -f $DEVICE; then
     
    247260{
    248261    stop
     262    if find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|grep -q vboxnetflt; then
     263        begin_msg "Removing old VirtualBox netflt kernel module"
     264        find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null
     265        succ_msg
     266    fi 
    249267    if find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then
    250       begin_msg "Removing old VirtualBox kernel module"
    251       find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
    252       succ_msg
     268        begin_msg "Removing old VirtualBox kernel module"
     269        find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null
     270        succ_msg
    253271    fi
    254272    begin_msg "Recompiling VirtualBox kernel module"
    255     if ! $BUILDINTMP install > $LOG 2>&1; then
     273    if ! $BUILDVBOXDRV \
     274        --save-module-symvers /tmp/vboxdrv-Module.symvers \
     275        --no-print-directory install > $LOG 2>&1; then
    256276        failure "Look at $LOG to find out what went wrong"
     277    fi
     278    if [ -n "$NETFLT" ]; then
     279        if ! $BUILDVBOXNETFLT \
     280            --use-module-symvers /tmp/vboxdrv-Module.symvers \
     281            --no-print-directory install >> $LOG 2>&1; then
     282            failure "Look at $LOG to find out what went wrong"
     283        fi
    257284    fi
    258285    succ_msg
     
    262289dmnstatus()
    263290{
    264     if running; then
    265         echo "VirtualBox kernel module is loaded."
     291    if running vboxdrv; then
     292        if running vboxnetflt; then
     293            echo "VirtualBox kernel modules (vboxdrv and vboxnetflt) are loaded."
     294        else
     295            echo "VirtualBox kernel module is loaded."
     296        fi
    266297        for i in $SHUTDOWN_USERS; do
    267298            # don't create the ipcd directory with wrong permissions!
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