loadnetadp.sh revision 334052e6de7b55199f6159fa6dfe5bf19591f12b
d5d12f5d4455786efdce0a22f09ec396bcb60718vboxsync# For development.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# Copyright (C) 2006-2008 Sun Microsystems, Inc.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# additional information or have any questions.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncXNU_VERSION=`LC_ALL=C uname -r | LC_ALL=C cut -d . -f 1`
3145bb572fc92a2c79eed3da96cff1ce2ea7da59vboxsyncif [ ! -d "$DIR" ]; then
3145bb572fc92a2c79eed3da96cff1ce2ea7da59vboxsync echo "Cannot find $DIR or it's not a directory..."
18589e4730562fe0d41783eb53496bea5a47af97vboxsyncif [ ! -d "$DEP_DIR" ]; then
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "Cannot find $DEP_DIR or it's not a directory... (dependency)"
18589e4730562fe0d41783eb53496bea5a47af97vboxsyncif [ -n "$*" ]; then
18589e4730562fe0d41783eb53496bea5a47af97vboxsynctrap "sudo chown -R `whoami` $DIR $DEP_DIR; exit 1" INT
18589e4730562fe0d41783eb53496bea5a47af97vboxsync# Try unload any existing instance first.
18589e4730562fe0d41783eb53496bea5a47af97vboxsyncif test -n "$LOADED"; then
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "${SCRIPT_NAME}.sh: Unloading $BUNDLE..."
18589e4730562fe0d41783eb53496bea5a47af97vboxsync if test -n "$LOADED"; then
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "${SCRIPT_NAME}.sh: failed to unload $BUNDLE, see above..."
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "${SCRIPT_NAME}.sh: Successfully unloaded $BUNDLE"
18589e4730562fe0d41783eb53496bea5a47af97vboxsync# Copy the .kext to the symbols directory and tweak the kextload options.
18589e4730562fe0d41783eb53496bea5a47af97vboxsyncif test -n "$VBOX_DARWIN_SYMS"; then
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "${SCRIPT_NAME}.sh: copying the extension the symbol area..."
d5d12f5d4455786efdce0a22f09ec396bcb60718vboxsync# On smbfs, this might succeed just fine but make no actual changes,
3145bb572fc92a2c79eed3da96cff1ce2ea7da59vboxsync# so we might have to temporarily copy the driver to a local directory.
18589e4730562fe0d41783eb53496bea5a47af97vboxsync echo "${SCRIPT_NAME}.sh: chown didn't work on $DIR, using temp location $TMP_DIR/$DRVNAME"
18589e4730562fe0d41783eb53496bea5a47af97vboxsync # clean up first (no sudo rm)
if test -e "$TMP_DIR"; then
# load.sh puts it here.