1 | #!/bin/bash
|
---|
2 | ## @file
|
---|
3 | # For development, loads all the host drivers.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-2015 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | if test -n "$Path" -a -z "$PATH"; then
|
---|
19 | export PATH="$Path"
|
---|
20 | fi
|
---|
21 |
|
---|
22 | MY_DIR=`cd "${0}/.." && cmd /c cd | kmk_sed -e 's,\\\\,/,g' `
|
---|
23 | if [ ! -d "${MY_DIR}" ]; then
|
---|
24 | echo "Cannot find ${MY_DIR} or it's not a directory..."
|
---|
25 | exit 1;
|
---|
26 | fi
|
---|
27 | echo MY_DIR=$MY_DIR
|
---|
28 |
|
---|
29 | set -e
|
---|
30 | cd "$MY_DIR"
|
---|
31 | set +e
|
---|
32 |
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Query the status of the drivers.
|
---|
36 | #
|
---|
37 | for drv in VBoxNetAdp VBoxNetAdp6 VBoxNetFlt VBoxNetLwf VBoxUSBMon VBoxUSB VBoxDrv;
|
---|
38 | do
|
---|
39 | if sc query $drv > /dev/null; then
|
---|
40 | STATE=`sc query $drv \
|
---|
41 | | kmk_sed -e '/^ *STATE /!d' -e 's/^[^:]*: [0-9 ]*//' \
|
---|
42 | -e 's/ */ /g' \
|
---|
43 | -e 's/^ *//g' \
|
---|
44 | -e 's/ *$//g' \
|
---|
45 | `
|
---|
46 | echo "loadall.sh: $drv - $STATE"
|
---|
47 | else
|
---|
48 | echo "loadall.sh: $drv - not configured, probably."
|
---|
49 | fi
|
---|
50 | done
|
---|
51 |
|
---|
52 | set -e
|
---|
53 | set -x
|
---|
54 |
|
---|
55 | #
|
---|
56 | # Invoke the uninstallers.
|
---|
57 | #
|
---|
58 | for uninst in NetAdpUninstall.exe NetAdp6Uninstall.exe USBUninstall.exe NetFltUninstall.exe NetLwfUninstall.exe SUPUninstall.exe;
|
---|
59 | do
|
---|
60 | if test -f ${MY_DIR}/$uninst; then
|
---|
61 | ${MY_DIR}/$uninst
|
---|
62 | fi
|
---|
63 | done
|
---|
64 |
|
---|
65 | #
|
---|
66 | # Invoke the installers.
|
---|
67 | #
|
---|
68 | if test "$1" != "-u" -a "$1" != "--uninstall"; then
|
---|
69 | INSTALLERS="SUPInstall.exe USBInstall.exe";
|
---|
70 | VER=`cmd.exe /c ver`
|
---|
71 | VER=`echo "$VER" | kmk_sed -e 's/^.*\[[^0-9]* \(.*\)\]/\1/' -e '/^$/d`
|
---|
72 | case "$VER" in
|
---|
73 | 6.*|10.*|11.*|12.*)
|
---|
74 | INSTALLERS="$INSTALLERS NetLwfInstall.exe"; #NetAdp6Install.exe - also busted?
|
---|
75 | ;;
|
---|
76 | *)
|
---|
77 | INSTALLERS="$INSTALLERS NetFltInstall.exe"; #NetAdpInstall.exe; - busted
|
---|
78 | ;;
|
---|
79 | esac
|
---|
80 |
|
---|
81 | for inst in $INSTALLERS;
|
---|
82 | do
|
---|
83 | if test -f ${MY_DIR}/$inst; then
|
---|
84 | ${MY_DIR}/$inst
|
---|
85 | fi
|
---|
86 | done
|
---|
87 | fi
|
---|
88 |
|
---|
89 | echo "loadall.sh: Successfully installed all drivers"
|
---|
90 | exit 0
|
---|
91 |
|
---|