VirtualBox

Ignore:
Timestamp:
Sep 19, 2017 4:15:20 PM (7 years ago)
Author:
vboxsync
Message:

solaris/vboxfs: added load script.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/SharedFolders/loadfs.sh

    r68794 r68795  
    2626#
    2727
    28 DRVNAME="vboxguest"
    29 DRIVERS_USING_IT="vboxfs"
     28DRVNAME="vboxfs"
     29MOUNTHLP="vboxfsmount"
    3030
    3131DRVFILE=`dirname "$0"`
    3232DRVFILE=`cd "$DRVFILE" && pwd`
     33MOUNTHLPFILE="$DRVFILE/$MOUNTHLP"
    3334DRVFILE="$DRVFILE/$DRVNAME"
    3435if [ ! -f "$DRVFILE" ]; then
    35     echo "load.sh: Cannot find $DRVFILE or it's not a file..."
     36    echo "loadfs.sh: Cannot find $DRVFILE or it's not a file..."
     37    exit 1;
     38fi
     39if [ ! -f "$MOUNTHLPFILE" ]; then
     40    echo "load.sh: Cannot find $MOUNTHLPFILE or it's not a file..."
    3641    exit 1;
    3742fi
     
    4045#set -x
    4146
    42 # Unload driver that may depend on the driver we're going to (re-)load
    43 # as well as the driver itself.
    44 for drv in $DRIVERS_USING_IT $DRVNAME;
     47# Unload the driver if loaded.
     48for drv in $DRVNAME;
    4549do
    4650    LOADED=`modinfo | grep -w "$drv"`
     
    5862
    5963#
    60 # Update the devlink.tab file so we get a /dev/vboxguest node.
    61 #
    62 set -e
    63 sed -e '/name=vboxguest/d' /etc/devlink.tab > /tmp/devlink.vbox
    64 echo "type=ddi_pseudo;name=vboxguest    \D" >> /tmp/devlink.vbox
    65 $SUDO cp /tmp/devlink.vbox /etc/devlink.tab
    66 $SUDO ln -fs ../devices/pci@0,0/pci80ee,cafe@4:vboxguest /dev/vboxguest
    67 set +e
    68 
    69 #
    70 # The add_drv command will load the driver, so we need to temporarily put it
    71 # in a place that is searched in order to load it.
     64# Remove old stuff.
    7265#
    7366MY_RC=1
    7467set -e
    7568$SUDO rm -f \
    76     "/usr/kernel/drv/${DRVNAME}" \
    77     "/usr/kernel/drv/amd64/${DRVNAME}"
     69    "/usr/kernel/fs/${DRVNAME}" \
     70    "/usr/kernel/fs/amd64/${DRVNAME}" \
     71    "/etc/fs/vboxfs/mount"
    7872sync
    79 $SUDO cp "${DRVFILE}"      /platform/i86pc/kernel/drv/amd64/
    8073set +e
    8174
    82 $SUDO rem_drv $DRVNAME
    83 if $SUDO add_drv -ipci80ee,cafe -m"* 0666 root sys" -v $DRVNAME; then
     75#
     76# Install the mount program.
     77#
     78if [ ! -d /etc/fs/vboxfs ]; then
     79    $SUDO mkdir -p /etc/fs/vboxfs
     80fi
     81$SUDO ln -sf "$MOUNTHLPFILE" /etc/fs/vboxfs/mount
     82
     83#
     84# Load the module. We can load it without copying it to /usr/kernel/fs/.
     85#
     86if $SUDO modload "$DRVFILE"; then
    8487    sync
    85     $SUDO /usr/sbin/devfsadm -i $DRVNAME
    8688    MY_RC=0
    8789else
     
    9092fi
    9193
    92 $SUDO rm -f \
    93     "/usr/kernel/drv/${DRVNAME}" \
    94     "/usr/kernel/drv/amd64/${DRVNAME}"
    95 sync
    96 
    9794exit $MY_RC;
    9895
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