VirtualBox

Changeset 34572 in vbox


Ignore:
Timestamp:
Dec 1, 2010 2:23:21 PM (14 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Installer/linux
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/VBoxCreateUSBNode.sh

    r34456 r34572  
    2020device=`expr "$2" '%' 128 + 1`
    2121class="$3"
     22group="$4"
    2223if test "$class" -eq 9; then
    2324  exit 0
     
    2627devpath="`printf "/dev/vboxusb/%.3d/%.3d" $bus $device`"
    2728if test "$do_remove" -eq 0; then
     29  if test -z "$group"; then
     30    group="vboxusers"
     31  fi
    2832  mkdir /dev/vboxusb -m 0750 2>/dev/null
    29   chown root:vboxusers /dev/vboxusb 2>/dev/null
     33  chown root:$group /dev/vboxusb 2>/dev/null
    3034  mkdir "$devdir" -m 0750 2>/dev/null
    31   chown root:vboxusers "$devdir" 2>/dev/null
     35  chown root:$group "$devdir" 2>/dev/null
    3236  mknod "$devpath" c $1 $2 -m 0660 2>/dev/null
    33   chown root:vboxusers "$devpath" 2>/dev/null
     37  chown root:$group "$devpath" 2>/dev/null
    3438else
    3539  rm -f "$devpath"
  • trunk/src/VBox/Installer/linux/debian

    • Property svn:ignore
      •  

        old new  
        1919virtualbox-*.debhelper
        2020virtualbox-*.debhelper.log
         21virtualbox-*.sharedmimeinfo
        2122wine.x86
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r32517 r34572  
    6363      > /etc/udev/rules.d/10-vboxdrv.rules
    6464    if [ "$INSTALL_NO_GROUP" != "1" ]; then
    65       echo "SUBSYSTEM=${udev_fix}\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
    66         >> /etc/udev/rules.d/10-vboxdrv.rules
    67       echo "SUBSYSTEM=${udev_fix}\"usb\", ENV{DEVTYPE}==\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
    68         >> /etc/udev/rules.d/10-vboxdrv.rules
    69     else
    70       echo "SUBSYSTEM=${udev_fix}\"usb_device\", GROUP=\"root\", MODE=\"0664\"" \
    71         >> /etc/udev/rules.d/10-vboxdrv.rules
    72       echo "SUBSYSTEM=${udev_fix}\"usb\", ENV{DEVTYPE}==\"usb_device\", GROUP=\"root\", MODE=\"0664\"" \
    73         >> /etc/udev/rules.d/10-vboxdrv.rules
    74     fi
     65        usb_group=vboxusers
     66    else
     67        usb_group=root
     68    fi
     69    usb_createnode="/usr/share/virtualbox/VBoxCreateUSBNode.sh"
     70    echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"add\", RUN=${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" ${usb_group} \
     71        >> /etc/udev/rules.d/10-vboxdrv.rules
     72    echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"add\", ENV{DEVTYPE}==\"usb_device\", RUN=${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" ${usb_group} \
     73        >> /etc/udev/rules.d/10-vboxdrv.rules
     74    echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"remove\", RUN=${usb_createnode} --remove \$major \$minor\"" \
     75        >> /etc/udev/rules.d/10-vboxdrv.rules
     76    echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN=${usb_createnode} --remove \$major \$minor\"" \
     77        >> /etc/udev/rules.d/10-vboxdrv.rules
    7578  fi
    7679  # Remove old udev description file
     
    7881      rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
    7982  fi
     83  # Build our device tree
     84  for i in /sys/bus/usb/devices/*; do
     85    if test -r "$i/dev"; then
     86      dev="`cat "$i/dev" 2> /dev/null`"
     87      major="`expr "$dev" : '\(.*\):' 2> /dev/null`"
     88      minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null`"
     89      class="`cat $i/bDeviceClass 2> /dev/null`"
     90      sh ${usb_createnode} "$major" "$minor" "$class" ${usb_group} 2>/dev/null
     91    fi
     92  done
    8093  # Push the permissions to the USB device nodes.  One of these should match.
    8194  # Rather nasty to use udevadm trigger for this, but I don't know of any
  • trunk/src/VBox/Installer/linux/debian/rules

    r34319 r34572  
    180180        rm -f debian/modules-stamp debian/build-stamp debian/configure-stamp
    181181        rm -f debian/virtualbox-*.substvars debian/virtualbox*.debhelper
     182        rm -f debian/$(verpkg).mime
    182183        rm -rf $(builddir) $(moddir)
    183184        rm -rf debian/wine.*
     
    204205           $(prefix)/usr/share/applications/virtualbox.desktop)
    205206        install -d -g 0 -o 0 $(prefix)/usr/share/pixmaps
     207        install -d -g 0 -o 0 $(prefix)/usr/share/icons/hicolor
     208        cd $(archdir)/icons; for i in *; do \
     209            install -d -g 0 -o 0 $(prefix)/usr/share/icons/hicolor/$$i/mimetypes; \
     210            mv $$i/* $(prefix)/usr/share/icons/hicolor/$$i/mimetypes; \
     211            rmdir $$i; \
     212        done
     213        rmdir $(archdir)/icons
     214        mv $(archdir)/virtualbox.xml debian/$(verpkg).sharedmimeinfo
    206215        install -d -g 0 -o 0 $(prefix)/usr/share/lintian/overrides
    207216        sed \
     
    234243        install -D -g 0 -o 0 -m 644 debian/VBox.sh $(prefix)/usr/bin/VBox
    235244        mv $(archdir)/VBoxSysInfo.sh $(prefix)/usr/share/$(package)
     245        mv $(archdir)/VBoxCreateUSBNode.sh $(prefix)/usr/share/$(package)
    236246        for i in VBoxManage VBoxSVC $(if $(HEADLESS),,VBoxSDL) \
    237247            $(if $(NOQT),,VirtualBox) VBoxHeadless \
     
    309319        dh_installchangelogs
    310320        dh_installmenu
     321        dh_installmime
    311322        dh_link
    312323ifeq ($(DEBUG),)
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r34563 r34572  
    6767install -m 755 -d $RPM_BUILD_ROOT/usr/share/applications
    6868install -m 755 -d $RPM_BUILD_ROOT/usr/share/pixmaps
     69install -m 755 -d $RPM_BUILD_ROOT/usr/share/icons/hicolor
     70cd icons
     71  for i in *; do
     72    install -d -g 0 -o 0 $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes
     73    mv $i/* $(prefix)/usr/share/icons/hicolor/$i/mimetypes
     74    rmdir $i
     75  done
     76cd -
    6977install -m 755 -d $RPM_BUILD_ROOT%{_defaultdocdir}/virtualbox
    7078install -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox
     
    92100mv VBox.sh $RPM_BUILD_ROOT/usr/bin/VBox
    93101mv VBoxSysInfo.sh $RPM_BUILD_ROOT/usr/share/virtualbox
     102mv VBoxCreateUSBNode.sh $RPM_BUILD_ROOT/usr/share/virtualbox
    94103for i in VBoxManage VBoxSVC VBoxSDL VirtualBox VBoxHeadless vboxwebsrv webtest; do
    95104  mv $i $RPM_BUILD_ROOT/usr/lib/virtualbox; done
     
    224233    fi
    225234  fi
     235  usb_createnode="/usr/share/virtualbox/VBoxCreateUSBNode.sh"
    226236  echo "KERNEL=${udev_fix}\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"root\", MODE=\"0600\"" \
    227237    > /etc/udev/rules.d/10-vboxdrv.rules
    228   echo "SUBSYSTEM=${udev_fix}\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
     238  echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"add\", RUN=${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
    229239    >> /etc/udev/rules.d/10-vboxdrv.rules
    230   echo "SUBSYSTEM=${udev_fix}\"usb\", ENV{DEVTYPE}==\"usb_device\", GROUP=\"vboxusers\", MODE=\"0664\"" \
     240  echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"add\", ENV{DEVTYPE}==\"usb_device\", RUN=${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
     241    >> /etc/udev/rules.d/10-vboxdrv.rules
     242  echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"remove\", RUN=${usb_createnode} --remove \$major \$minor\"" \
     243    >> /etc/udev/rules.d/10-vboxdrv.rules
     244  echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN=${usb_createnode} --remove \$major \$minor\"" \
    231245    >> /etc/udev/rules.d/10-vboxdrv.rules
    232246fi
     
    235249  rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
    236250fi
     251# Build our device tree
     252for i in /sys/bus/usb/devices/*; do
     253  if test -r "$i/dev"; then
     254    dev="`cat "$i/dev" 2> /dev/null`"
     255    major="`expr "$dev" : '\(.*\):' 2> /dev/null`"
     256    minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null`"
     257    class="`cat $i/bDeviceClass 2> /dev/null`"
     258    sh ${usb_createnode} "$major" "$minor" "$class" ${usb_group} 2>/dev/null
     259  fi
     260done
    237261# Push the permissions to the USB device nodes.  One of these should match.
    238262# Rather nasty to use udevadm trigger for this, but I don't know of any
     
    411435/usr/share/pixmaps
    412436/usr/share/virtualbox
     437/usr/share/icons
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