VirtualBox

Changeset 17859 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Mar 13, 2009 9:54:04 PM (16 years ago)
Author:
vboxsync
Message:

Additions/Linux/installer: add support for /dev/vboxuser to vboxadd.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r17409 r17859  
    143143
    144144dev=/dev/vboxadd
     145userdev=/dev/vboxuser
    145146owner=vboxadd
    146147group=1
     
    173174        rm -f $dev || {
    174175            fail "Cannot remove $dev"
     176        }
     177
     178        rm -f $userdev || {
     179            fail "Cannot remove $userdev"
    175180        }
    176181
     
    200205        }
    201206    fi
     207    if [ ! -c $userdev ]; then
     208        maj=0
     209        min=`sed -n 's;\([0-9]\+\) vboxuser;\1;p' /proc/misc`
     210        if [ ! -z "$min" ]; then
     211            maj=10
     212        fi
     213        test ! -z "$maj" && mknod -m 0666 $userdev c $maj $min || {
     214            rm -f $dev 2>/dev/null
     215            rmmod vboxadd 2>/dev/null
     216            fail "Cannot create device $userdev with major $maj and minor $min"
     217        }
     218    fi
    202219    chown $owner:$group $dev 2>/dev/null || {
     220        rm -f $dev 2>/dev/null
     221        rm -f $userdev 2>/dev/null
    203222        rmmod vboxadd 2>/dev/null
    204223        fail "Cannot change owner $owner:$group for device $dev"
     224    }
     225    chown $owner:$group $userdev 2>/dev/null || {
     226        rm -f $dev 2>/dev/null
     227        rm -f $userdev 2>/dev/null
     228        rmmod vboxadd 2>/dev/null
     229        fail "Cannot change owner $owner:$group for device $userdev"
    205230    }
    206231
     
    240265    if running_vboxadd; then
    241266        rmmod vboxadd 2>/dev/null || fail "Cannot unload module vboxadd"
     267        rm -f $userdev || fail "Cannot unlink $userdev"
    242268        rm -f $dev || fail "Cannot unlink $dev"
    243269    fi
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