Last change
on this file since 34456 was 34456, checked in by vboxsync, 14 years ago |
Main/linux/USB and Installer/linux: switch to using our own device tree under /dev
|
-
Property svn:eol-style
set to
LF
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
872 bytes
|
Line | |
---|
1 | #! /bin/sh
|
---|
2 | # $Id: VBoxCreateUSBNode.sh 34456 2010-11-29 12:20:42Z vboxsync $ */
|
---|
3 | ## @file
|
---|
4 | # VirtualBox USB Proxy Service, Linux Specialization.
|
---|
5 | # udev helper for creating and removing device nodes for VirtualBox USB devices
|
---|
6 | #
|
---|
7 |
|
---|
8 | #
|
---|
9 | # Copyright (C) 2010 Oracle Corporation
|
---|
10 | #
|
---|
11 | # Oracle Corporation confidential
|
---|
12 | # All rights reserved
|
---|
13 | #
|
---|
14 |
|
---|
15 | do_remove=0
|
---|
16 | case "$1" in "--remove")
|
---|
17 | do_remove=1; shift;;
|
---|
18 | esac
|
---|
19 | bus=`expr "$2" '/' 128 + 1`
|
---|
20 | device=`expr "$2" '%' 128 + 1`
|
---|
21 | class="$3"
|
---|
22 | if test "$class" -eq 9; then
|
---|
23 | exit 0
|
---|
24 | fi
|
---|
25 | devdir="`printf "/dev/vboxusb/%.3d" $bus`"
|
---|
26 | devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
|
---|
27 | if test "$do_remove" -eq 0; then
|
---|
28 | mkdir /dev/vboxusb -m 0750 2>/dev/null
|
---|
29 | chown root:vboxusers /dev/vboxusb 2>/dev/null
|
---|
30 | mkdir "$devdir" -m 0750 2>/dev/null
|
---|
31 | chown root:vboxusers "$devdir" 2>/dev/null
|
---|
32 | mknod "$devpath" c $1 $2 -m 0660 2>/dev/null
|
---|
33 | chown root:vboxusers "$devpath" 2>/dev/null
|
---|
34 | else
|
---|
35 | rm -f "$devpath"
|
---|
36 | fi
|
---|
37 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.