VirtualBox

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

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

OSE header fix

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1#! /bin/sh
2# $Id: VBoxCreateUSBNode.sh 34726 2010-12-05 19:39:07Z 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# This file is part of VirtualBox Open Source Edition (OSE), as
12# available from http://www.virtualbox.org. This file is free software;
13# you can redistribute it and/or modify it under the terms of the GNU
14# General Public License (GPL) as published by the Free Software
15# Foundation, in version 2 as it comes in the "COPYING" file of the
16# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18#
19
20do_remove=0
21case "$1" in "--remove")
22 do_remove=1; shift;;
23esac
24bus=`expr "$2" '/' 128 + 1`
25device=`expr "$2" '%' 128 + 1`
26class="$3"
27group="$4"
28if test "$class" -eq 9; then
29 exit 0
30fi
31devdir="`printf "/dev/vboxusb/%.3d" $bus`"
32devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
33if test "$do_remove" -eq 0; then
34 if test -z "$group"; then
35 group="vboxusers"
36 fi
37 mkdir /dev/vboxusb -m 0750 2>/dev/null
38 chown root:$group /dev/vboxusb 2>/dev/null
39 mkdir "$devdir" -m 0750 2>/dev/null
40 chown root:$group "$devdir" 2>/dev/null
41 mknod "$devpath" c $1 $2 -m 0660 2>/dev/null
42 chown root:$group "$devpath" 2>/dev/null
43else
44 rm -f "$devpath"
45fi
46
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