VirtualBox

Ignore:
Timestamp:
May 13, 2011 9:17:29 PM (14 years ago)
Author:
vboxsync
Message:

Installer/linux: split out udev rule installation in order to share the code among the different Linux installers, added a testcase and fixed a broken rule found by the testcase

Location:
trunk/src/VBox/Installer/linux/rpm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r37087 r37088  
    219219
    220220%post
     221#include installer-utils.sh
     222
    221223LOG="/var/log/vbox-install.log"
    222224
     
    236238
    237239# install udev rule (disable with INSTALL_NO_UDEV=1 in /etc/default/virtualbox)
    238 if [ -d /etc/udev/rules.d -a "$INSTALL_NO_UDEV" != "1" ]; then
    239   udev_call=""
    240   udev_app=`which udevadm 2> /dev/null`
    241   if [ $? -eq 0 ]; then
    242     udev_call="${udev_app} version 2> /dev/null"
    243   else
    244     udev_app=`which udevinfo 2> /dev/null`
    245     if [ $? -eq 0 ]; then
    246       udev_call="${udev_app} -V 2> /dev/null"
    247     fi
    248   fi
    249   udev_fix="="
    250   if [ "${udev_call}" != "" ]; then
    251     udev_out=`${udev_call}`
    252     udev_ver=`expr "$udev_out" : '[^0-9]*\([0-9]*\)'`
    253     if [ "$udev_ver" = "" -o "$udev_ver" -lt 55 ]; then
    254       udev_fix=""
    255     fi
    256   fi
    257   usb_createnode="/usr/share/virtualbox/VBoxCreateUSBNode.sh"
    258   echo "KERNEL=${udev_fix}\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"root\", MODE=\"0600\"" \
    259     > /etc/udev/rules.d/10-vboxdrv.rules
    260   echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"add\", RUN=\"${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
    261     >> /etc/udev/rules.d/10-vboxdrv.rules
    262   echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"add\", ENV{DEVTYPE}==\"usb_device\", RUN=\"${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
    263     >> /etc/udev/rules.d/10-vboxdrv.rules
    264   echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"remove\", RUN=\"${usb_createnode} --remove \$major \$minor\"" \
    265     >> /etc/udev/rules.d/10-vboxdrv.rules
    266   echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN=\"${usb_createnode} --remove \$major \$minor\"" \
    267     >> /etc/udev/rules.d/10-vboxdrv.rules
    268 fi
    269 # Remove old udev description file
    270 if [ -f /etc/udev/rules.d/60-vboxdrv.rules ]; then
    271   rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
    272 fi
     240install_udev_package vboxusers > /etc/udev/rules.d/10-vboxdrv.rules
     241
    273242# Build our device tree
    274243for i in /sys/bus/usb/devices/*; do
  • trunk/src/VBox/Installer/linux/rpm/rules

    r36782 r37088  
    171171          -e 's|%INSTMOD%|$(instmod)|g' \
    172172          -e 's|%LIBASOUND%|$(if $(filter lib64,$(rpmlib)),libasound.so.2()(64bit),libasound.so.2)|g' \
     173          -e '/#include installer-utils.sh/ {' \
     174          -e "r $(vboxroot)/src/VBox/Installer/linux/installer-utils.sh" \
     175          -e 'd' \
     176          -e '}' \
    173177           rpm/VirtualBox.tmpl.spec > $(archdir)/VirtualBox.spec
    174178        sed \
Note: See TracChangeset for help on using the changeset viewer.

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