VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/VBoxCreateUSBNode.sh@ 34572

Last change on this file since 34572 was 34572, checked in by vboxsync, 14 years ago

deb/rpm: adapted USB udev rules according to r68230; icons and mime (rpm needs some more work)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 929 bytes
Line 
1#! /bin/sh
2# $Id: VBoxCreateUSBNode.sh 34572 2010-12-01 14:23:21Z 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
15do_remove=0
16case "$1" in "--remove")
17 do_remove=1; shift;;
18esac
19bus=`expr "$2" '/' 128 + 1`
20device=`expr "$2" '%' 128 + 1`
21class="$3"
22group="$4"
23if test "$class" -eq 9; then
24 exit 0
25fi
26devdir="`printf "/dev/vboxusb/%.3d" $bus`"
27devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
28if test "$do_remove" -eq 0; then
29 if test -z "$group"; then
30 group="vboxusers"
31 fi
32 mkdir /dev/vboxusb -m 0750 2>/dev/null
33 chown root:$group /dev/vboxusb 2>/dev/null
34 mkdir "$devdir" -m 0750 2>/dev/null
35 chown root:$group "$devdir" 2>/dev/null
36 mknod "$devpath" c $1 $2 -m 0660 2>/dev/null
37 chown root:$group "$devpath" 2>/dev/null
38else
39 rm -f "$devpath"
40fi
41
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette