Changeset 37122 in vbox for trunk/src/VBox
- Timestamp:
- May 17, 2011 11:06:19 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/installer-utils.sh
r37120 r37122 33 33 } 34 34 35 udev_write_ rules() {35 udev_write_vboxdrv() { 36 36 VBOXDRV_GRP="$1" 37 37 VBOXDRV_MODE="$2" 38 INSTALLATION_DIR="$3"39 USB_GROUP="$4"40 38 41 echo "KERNEL=${udev_fix}\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"$VBOXDRV_GRP\", MODE=\"$VBOXDRV_MODE\"" 42 echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"add\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\"" 43 echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"add\", ENV{DEVTYPE}=${udev_fix}\"usb_device\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\"" 44 echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"remove\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\"" 45 echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"remove\", ENV{DEVTYPE}=${udev_fix}\"usb_device\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\"" 39 echo "KERNEL==\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"$VBOXDRV_GRP\", MODE=\"$VBOXDRV_MODE\"" 40 } 41 42 udev_write_usb() { 43 INSTALLATION_DIR="$1" 44 USB_GROUP="$2" 45 46 echo "SUBSYSTEM==\"usb_device\", ACTION==\"add\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\"" 47 echo "SUBSYSTEM==\"usb\", ACTION==\"add\", ENV{DEVTYPE}==\"usb_device\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass}${USB_GROUP}\"" 48 echo "SUBSYSTEM==\"usb_device\", ACTION==\"remove\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\"" 49 echo "SUBSYSTEM==\"usb\", ACTION==\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN=\"$INSTALLATION_DIR/VBoxCreateUSBNode.sh --remove \$major \$minor\"" 46 50 } 47 51 … … 57 61 case "$USB_GROUP" in ?*) USB_GROUP=" $USB_GROUP" ;; esac 58 62 case "$NO_INSTALL" in 59 60 63 "1") ;; 64 *) 61 65 if my_test -d /etc/udev/rules.d; then 62 66 udev_call="" … … 70 74 fi 71 75 fi 72 udev_fix=" ="76 udev_fix="" 73 77 if [ "${udev_call}" != "" ]; then 74 78 udev_out=`${udev_call}` 75 79 udev_ver=`expr "$udev_out" : '[^0-9]*\([0-9]*\)'` 76 80 if [ "$udev_ver" = "" -o "$udev_ver" -lt 55 ]; then 77 udev_fix=" "81 udev_fix="1" 78 82 fi 79 83 fi 80 udev_write_rules "$VBOXDRV_GRP" "$VBOXDRV_MODE" \ 81 "$INSTALLATION_DIR" "$USB_GROUP" 84 case "$udev_fix" in 85 "1") 86 udev_write_vboxdrv "$VBOXDRV_GRP" "$VBOXDRV_MODE" | 87 sed 's/\([^+=]*\)[+=]*\([^"]*"[^"]*"\)/\1=\2/g' 88 udev_write_usb "$INSTALLATION_DIR" "$USB_GROUP" | 89 sed 's/\([^+=]*\)[+=]*\([^"]*"[^"]*"\)/\1=\2/g' 90 ;; 91 *) 92 udev_write_vboxdrv "$VBOXDRV_GRP" "$VBOXDRV_MODE" 93 udev_write_usb "$INSTALLATION_DIR" "$USB_GROUP" 94 ;; 95 esac 96 82 97 fi 83 98 ;;
Note:
See TracChangeset
for help on using the changeset viewer.