VirtualBox

Changeset 15585 in vbox for trunk


Ignore:
Timestamp:
Dec 16, 2008 2:00:12 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41094
Message:

Linux additions: merged vboxvfs with vboxadd since vboxvfs has module dependencies to vboxadd

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

Legend:

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

    r12446 r15585  
    9898                $(PATH_BIN)/additions/vboxvideo_drv_14.so \
    9999                $(PATH_BIN)/additions/vboxvideo_drv_15.so \
    100                 $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/vboxvfs.sh $(PATH_BIN)/additions/mountvboxsf \
     100                $(PATH_BIN)/additions/mountvboxsf \
    101101                $(VBOX_SELINUX_CMPLD) \
    102102                $(wildcard $(PATH_BIN)/additions/src/*) \
     
    149149        $(QUIET)$(VBOX_LNX_ADD_BIN_COPY) $(PATH_BIN)/additions/vboxvideo_drv_15.so           $(VBOX_LNX_ADD_INS_OUT_DIR)/vboxvideo_drv_15.so
    150150        $(QUIET)$(VBOX_LNX_ADD_BIN_COPY) $(PATH_BIN)/additions/mountvboxsf                   $(VBOX_LNX_ADD_INS_OUT_DIR)/mount.vboxsf
    151         $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/vboxvfs.sh          $(VBOX_LNX_ADD_INS_OUT_DIR)
    152151ifdef VBOX_SELINUX_CMPLD
    153152        $(QUIET)$(INSTALL) -m 0755 $(VBOX_SELINUX_CMPLD)                                     $(VBOX_LNX_ADD_INS_OUT_DIR)
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r11274 r15585  
    2020
    2121# chkconfig: 35 30 60
    22 # description: VirtualBox Linux Additions kernel module
     22# description: VirtualBox Linux Additions kernel modules
    2323#
    2424### BEGIN INIT INFO
     
    2828# Default-Start:  2 3 4 5
    2929# Default-Stop:   0 1 6
    30 # Description:    VirtualBox Linux Additions kernel module
     30# Description:    VirtualBox Linux Additions kernel modules
    3131### END INIT INFO
    3232
    3333PATH=$PATH:/bin:/sbin:/usr/sbin
     34BUILDVBOXADD=`/bin/ls /usr/src/vboxadd*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     35BUILDVBOXVFS=`/bin/ls /usr/src/vboxvfs*/build_in_tmp 2>/dev/null|cut -d' ' -f1`
     36LOG="/var/log/vboxadd-install.log"
    3437
    3538if [ -f /etc/redhat-release ]; then
     
    110113fi
    111114
    112 kdir=/lib/modules/`uname -r`/misc
    113115dev=/dev/vboxadd
    114 modname=vboxadd
    115 module=$kdir/$modname
    116116owner=vboxadd
    117117group=1
    118118
    119 fail() {
     119fail()
     120{
    120121    if [ "$system" = "gentoo" ]; then
    121122        eerror $1
     
    127128}
    128129
    129 running() {
    130     lsmod | grep -q "$modname[^_-]"
    131 }
    132 
    133 start() {
     130running_vboxadd()
     131{
     132    lsmod | grep -q "vboxadd[^_-]"
     133}
     134
     135running_vboxvfs()
     136{
     137    lsmod | grep -q "vboxvfs[^_-]"
     138}
     139
     140start()
     141{
    134142    begin "Starting VirtualBox Additions ";
    135     running || {
     143    running_vboxadd || {
    136144        rm -f $dev || {
    137145            fail "Cannot remove $dev"
    138146        }
    139147
    140         modprobe $modname >/dev/null 2>&1 || {
    141             fail "modprobe $modname failed"
    142         }
    143 
     148        modprobe vboxadd >/dev/null 2>&1 || {
     149            fail "modprobe vboxadd failed"
     150        }
    144151        sleep .5
    145152    }
     
    155162        fi
    156163        test -z "$maj" && {
    157             rmmod $modname 2>/dev/null
     164            rmmod vboxadd 2>/dev/null
    158165            fail "Cannot locate the VirtualBox device"
    159166        }
    160167
    161168        mknod -m 0664 $dev c $maj $min || {
    162             rmmod $modname 2>/dev/null
     169            rmmod vboxadd 2>/dev/null
    163170            fail "Cannot create device $dev with major $maj and minor $min"
    164171        }
    165172    fi
    166 
    167173    chown $owner:$group $dev 2>/dev/null || {
    168         rmmod $modname 2>/dev/null
     174        rmmod vboxadd 2>/dev/null
    169175        fail "Cannot change owner $owner:$group for device $dev"
    170176    }
     177
     178    if [ -n "$BUILDVBOXVFS" ]; then
     179        running_vboxvfs || {
     180            modprobe vboxvfs > /dev/null 2>&1 || {
     181                if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then
     182                    fail_msg
     183                    echo "You may be trying to run Guest Additions from binary release of VirtualBox"
     184                    echo "in the Open Source Edition."
     185                    exit 1
     186                fi
     187                fail "modprobe vboxvfs failed"
     188            }
     189        }
     190    fi
     191
     192    # Mount all shared folders from /etc/fstab. Normally this is done by some
     193    # other startup script but this requires the vboxdrv kernel module loaded.
     194    mount -a -t vboxsf
    171195
    172196    succ_msg
     
    174198}
    175199
    176 stop() {
     200stop()
     201{
    177202    begin "Stopping VirtualBox Additions ";
    178     if running; then
    179         rmmod $modname 2>/dev/null || fail "Cannot unload module $modname"
     203    if !umount -a -t vboxsf 2>/dev/null; then
     204        fail "Cannot unmount vboxsf folders"
     205    fi
     206    if [ -n "$BUILDVBOXVFS" ]; then
     207        if running_vboxvfs; then
     208            rmmod vboxvfs 2>/dev/null || fail "Cannot unload module vboxvfs"
     209        fi
     210    fi
     211    if running_vboxadd; then
     212        rmmod vboxadd 2>/dev/null || fail "Cannot unload module vboxadd"
    180213        rm -f $dev || fail "Cannot unlink $dev"
    181214    fi
     
    184217}
    185218
    186 restart() {
     219restart()
     220{
    187221    stop && start
    188222    return 0
    189223}
    190224
    191 dmnstatus() {
    192     if running; then
     225setup()
     226{
     227    # don't stop the old modules here -- they might be in use
     228    if find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|grep -q vboxvfs; then
     229        begin "Removing old VirtualBox vboxvfs kernel module"
     230        find /lib/modules/`uname -r` -name "vboxvfs\.*" 2>/dev/null|xargs rm -f 2>/dev/null
     231        succ_msg
     232    fi 
     233    if find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|grep -q vboxadd; then
     234        begin "Removing old VirtualBox vboxadd kernel module"
     235        find /lib/modules/`uname -r` -name "vboxadd\.*" 2>/dev/null|xargs rm -f 2>/dev/null
     236        succ_msg
     237    fi
     238    begin "Recompiling VirtualBox kernel modules"
     239    if ! $BUILDVBOXADD \
     240        --save-module-symvers /tmp/vboxadd-Module.symvers \
     241        --no-print-directory install > $LOG 2>&1; then
     242        fail "Look at $LOG to find out what went wrong"
     243    fi
     244    if [ -n "$BUILDVBOXVFS" ]; then
     245        if ! $BUILDVBOXVFS \
     246            --use-module-symvers /tmp/vboxadd-Module.symvers \
     247            --no-print-directory install >> $LOG 2>&1; then
     248            fail "Look at $LOG to find out what went wrong"
     249        fi
     250    fi
     251    start
     252    succ_msg
     253    echo
     254    echo "You should reboot your guest to make sure the new modules are actually used"
     255}
     256
     257dmnstatus()
     258{
     259    if running_vboxadd; then
    193260        echo "The VirtualBox Additions are currently running."
    194261    else
     
    206273restart)
    207274    restart
     275    ;;
     276setup)
     277    setup
    208278    ;;
    209279status)
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