VirtualBox

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

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
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"
22if test "$class" -eq 9; then
23 exit 0
24fi
25devdir="`printf "/dev/vboxusb/%.3d" $bus`"
26devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
27if 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
34else
35 rm -f "$devpath"
36fi
37
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