VirtualBox

Changeset 63757 in vbox


Ignore:
Timestamp:
Sep 7, 2016 5:51:48 PM (8 years ago)
Author:
vboxsync
Message:

bugref:8569: Add SELinux rule to allow vboxdrv.sh access to /etc/udev/rules.d: create udev rules at installation time, not at boot time, to make SELinux happier.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/linux/load.sh

    r58431 r63757  
    3333
    3434# Unload, but keep the udev rules.
    35 sudo "${MY_DIR}/vboxdrv.sh" stop_keep_udev
     35sudo "${MY_DIR}/vboxdrv.sh" stop
    3636
    3737if [ -z "${OPT_UNLOAD_ONLY}" ]; then
  • trunk/src/VBox/Installer/linux/vboxdrv.sh

    r62730 r63757  
    186186
    187187## Install udev rules and create device nodes for usb access
    188 install_device_node_setup() {
     188setup_usb() {
    189189    VBOXDRV_GRP="$1"      # The group that should own /dev/vboxdrv
    190190    VBOXDRV_MODE="$2"     # The mode to be used for /dev/vboxdrv
     
    213213}
    214214
     215cleanup_usb()
     216{
     217    # Remove udev description file
     218    rm -f /etc/udev/rules.d/60-vboxdrv.rules
     219    rm -f /etc/udev/rules.d/10-vboxdrv.rules
     220
     221    # Remove our USB device tree
     222    rm -rf /dev/vboxusb
     223}
     224
    215225start()
    216226{
    217227    begin_msg "Starting VirtualBox services" console
    218     # Create udev rule and USB device nodes.
    219     ## todo Wouldn't it make more sense to install the rule to /lib/udev?  This
    220     ## is not a user-created configuration file after all.
    221     ## todo Do we need a udev rule to create /dev/vboxdrv[u] at all?  We have
    222     ## working fall-back code here anyway, and the "right" code is more complex
    223     ## than the fall-back.  Unnecessary duplication?
    224     install_device_node_setup "$GROUP" "$DEVICE_MODE" "$INSTALL_DIR"
    225228    if [ -d /proc/xen ]; then
    226229        failure "Running VirtualBox in a Xen environment is not supported"
     
    286289stop()
    287290{
    288     if test ${#} -eq 0 || ! test "${1}" = "--keep-udev"; then
    289         begin_msg "Stopping VirtualBox services" console
    290 
    291         # Remove udev description file
    292         rm -f /etc/udev/rules.d/60-vboxdrv.rules
    293         rm -f /etc/udev/rules.d/10-vboxdrv.rules
    294 
    295         # Remove our USB device tree
    296         rm -rf /dev/vboxusb
    297     else
    298         begin_msg "Stopping VirtualBox services (keeping udev + usb)" console
    299     fi
     291    begin_msg "Stopping VirtualBox services" console
    300292
    301293    if running vboxpci; then
     
    471463    stop_vms
    472464    ;;
    473 stop_keep_udev)
    474     # This is used by src/VBox/HostDrivers/linux/load.sh.
    475     stop_vms
    476     stop --keep-udev
    477     ;;
    478465restart)
    479466    stop && start
    480467    ;;
    481468setup)
     469    # Create udev rule and USB device nodes.
     470    ## todo Wouldn't it make more sense to install the rule to /lib/udev?  This
     471    ## is not a user-created configuration file after all.
     472    ## todo Do we need a udev rule to create /dev/vboxdrv[u] at all?  We have
     473    ## working fall-back code here anyway, and the "right" code is more complex
     474    ## than the fall-back.  Unnecessary duplication?
     475    setup_usb "$GROUP" "$DEVICE_MODE" "$INSTALL_DIR"
    482476    setup && start
    483477    ;;
    484478cleanup)
    485479    stop && cleanup
     480    cleanup_usb
    486481    ;;
    487482force-reload)
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