VirtualBox

Changeset 49867 in vbox for trunk/src


Ignore:
Timestamp:
Dec 10, 2013 2:34:12 PM (11 years ago)
Author:
vboxsync
Message:

Solaris/Installer: Fix vboxdrvu to work in zones.

Location:
trunk/src/VBox/Installer/solaris
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/VBoxZoneAccess.c

    r48954 r49867  
    3131*******************************************************************************/
    3232#define DEVICE_NAME     "/devices/pseudo/vboxdrv@0:vboxdrv"
    33 
     33#define DEVICE_NAME_USR "/devices/pseudo/vboxdrv@0:vboxdrvu"
    3434
    3535int main(int argc, char *argv[])
    3636{
    3737    int hDevice = -1;
     38    int hDeviceUsr = -1;
    3839
    3940    /* Check root permissions. */
     
    5758    }
    5859
     60    /* Open the user device. */
     61    hDeviceUsr = open(DEVICE_NAME_USR, O_RDWR, 0);
     62    if (hDeviceUsr < 0)
     63    {
     64        fprintf(stderr, "Failed to open '%s'. errno=%d\n", DEVICE_NAME_USR, errno);
     65        close(hDevice);
     66        return errno;
     67    }
     68
    5969    /* Mark the file handle close on exec. */
    60     if (fcntl(hDevice, F_SETFD, FD_CLOEXEC) != 0)
     70    if (   fcntl(hDevice,    F_SETFD, FD_CLOEXEC) != 0
     71        || fcntl(hDeviceUsr, F_SETFD, FD_CLOEXEC) != 0)
    6172    {
    6273        fprintf(stderr, "Failed to set close on exec. errno=%d\n", errno);
    6374        close(hDevice);
     75        close(hDeviceUsr);
    6476        return errno;
    6577    }
     
    7082
    7183    close(hDevice);
     84    close(hDeviceUsr);
    7285
    7386    return 0;
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r48954 r49867  
    619619
    620620    ## Add vboxdrv to devlink.tab (KEEP TABS!)
    621     # clean up devlink.tab (KEEP TABS!)
    622621    if test -f "$PKG_INSTALL_ROOT/etc/devlink.tab"; then
    623622        sed -e '/name=vboxdrv/d' -e '/name=vboxdrvu/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    624         #echo "type=ddi_pseudo;name=vboxdrv;minor=vboxdrv       \D"  >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    625         #echo "type=ddi_pseudo;name=vboxdrv;minor=vboxdrvu      \M0" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
     623        echo "type=ddi_pseudo;name=vboxdrv;minor=vboxdrv        \D"  >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
     624        echo "type=ddi_pseudo;name=vboxdrv;minor=vboxdrvu       \M0" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    626625        mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
    627626    else
     
    633632    if test "$REMOTEINST" -eq 0; then
    634633        /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
    635         #if test $? -ne 0 || test ! -h "/dev/vboxdrv" || test ! -h "/dev/vboxdrvu" ; then
    636         #    errorprint "Failed to create device link for $MOD_VBOXDRV."
    637         #    exit 1
    638         #fi
     634        if test $? -ne 0 || test ! -h "/dev/vboxdrv" || test ! -h "/dev/vboxdrvu" ; then
     635            errorprint "Failed to create device link for $MOD_VBOXDRV."
     636            exit 1
     637        fi
    639638    fi
    640639
     
    718717    fatal=$1
    719718
    720     # Remove vboxdrv from devlink.tab
     719    # Remove vboxdrv[u] from devlink.tab
    721720    if test -f "$PKG_INSTALL_ROOT/etc/devlink.tab"; then
    722721        devlinkfound=`cat "$PKG_INSTALL_ROOT/etc/devlink.tab" | grep vboxdrv`
    723722        if test -n "$devlinkfound"; then
    724             sed -e '/name=vboxdrv/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
     723            sed -e '/name=vboxdrv/d' -e '/name=vboxdrvu/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    725724            mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
    726725        fi
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