VirtualBox

source: vbox/trunk/src/VBox/Additions/solaris/SharedFolders/loadfs.sh@ 78393

Last change on this file since 78393 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1#!/bin/bash
2# $Id: loadfs.sh 76553 2019-01-01 01:45:53Z vboxsync $
3## @file
4# For GA development.
5#
6
7#
8# Copyright (C) 2006-2019 Oracle Corporation
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18# The contents of this file may alternatively be used under the terms
19# of the Common Development and Distribution License Version 1.0
20# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21# VirtualBox OSE distribution, in which case the provisions of the
22# CDDL are applicable instead of those of the GPL.
23#
24# You may elect to license modified versions of this file under the
25# terms and conditions of either the GPL or the CDDL or both.
26#
27
28DRVNAME="vboxfs"
29MOUNTHLP="vboxfsmount"
30
31DRVFILE=`dirname "$0"`
32DRVFILE=`cd "$DRVFILE" && pwd`
33MOUNTHLPFILE="$DRVFILE/$MOUNTHLP"
34DRVFILE="$DRVFILE/$DRVNAME"
35if [ ! -f "$DRVFILE" ]; then
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..."
41 exit 1;
42fi
43
44SUDO=sudo
45#set -x
46
47# Unload the driver if loaded.
48for drv in $DRVNAME;
49do
50 LOADED=`modinfo | grep -w "$drv"`
51 if test -n "$LOADED"; then
52 MODID=`echo "$LOADED" | cut -d ' ' -f 1`
53 $SUDO modunload -i $MODID;
54 LOADED=`modinfo | grep -w "$drv"`;
55 if test -n "$LOADED"; then
56 echo "load.sh: failed to unload $drv";
57 dmesg | tail
58 exit 1;
59 fi
60 fi
61done
62
63#
64# Remove old stuff.
65#
66MY_RC=1
67set -e
68$SUDO rm -f \
69 "/usr/kernel/fs/${DRVNAME}" \
70 "/usr/kernel/fs/amd64/${DRVNAME}" \
71 "/etc/fs/vboxfs/mount"
72sync
73set +e
74
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
87 sync
88 MY_RC=0
89else
90 dmesg | tail
91 echo "load.sh: add_drv failed."
92fi
93
94exit $MY_RC;
95
Note: See TracBrowser for help on using the repository browser.

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