1 | #!/bin/sh
|
---|
2 | # $Id: pkginstall.sh 69500 2017-10-28 15:14:05Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | #
|
---|
5 | # VirtualBox postinstall script for Solaris.
|
---|
6 | #
|
---|
7 | # If you just installed VirtualBox using IPS/pkg(5), you should run this
|
---|
8 | # script once to avoid rebooting the system before using VirtualBox.
|
---|
9 | #
|
---|
10 |
|
---|
11 | #
|
---|
12 | # Copyright (C) 2009-2017 Oracle Corporation
|
---|
13 | #
|
---|
14 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
15 | # available from http://www.virtualbox.org. This file is free software;
|
---|
16 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
17 | # General Public License (GPL) as published by the Free Software
|
---|
18 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
19 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
20 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
21 | #
|
---|
22 |
|
---|
23 | if test "$1" != "--srv4"; then
|
---|
24 | # IPS package
|
---|
25 | echo "Checking for older & partially installed bits..."
|
---|
26 | ISIPS="--ips"
|
---|
27 | else
|
---|
28 | # SRv4 package
|
---|
29 | echo "Checking for older bits..."
|
---|
30 | ISIPS=""
|
---|
31 | fi
|
---|
32 |
|
---|
33 | # pkgadd -v
|
---|
34 | if test "$1" = "--sh-trace" || test "$2" = "--sh-trace" || test "$3" = "--sh-trace"; then
|
---|
35 | set -x
|
---|
36 | fi
|
---|
37 | DEBUGOPT=`set -o 2>/dev/null | sed -ne 's/^xtrace *on$/--sh-trace/p'` # propagate pkgadd -v
|
---|
38 |
|
---|
39 | # If PKG_INSTALL_ROOT is undefined or NULL, redefine to '/' and carry on.
|
---|
40 | ${PKG_INSTALL_ROOT:=/}/opt/VirtualBox/vboxconfig.sh --preremove --fatal ${ISIPS} ${DEBUGOPT}
|
---|
41 |
|
---|
42 | if test "$?" -eq 0; then
|
---|
43 | echo "Installing new ones..."
|
---|
44 | $PKG_INSTALL_ROOT/opt/VirtualBox/vboxconfig.sh --postinstall ${DEBUGOPT}
|
---|
45 | rc=$?
|
---|
46 | if test "$rc" -ne 0; then
|
---|
47 | echo 1>&2 "## Completed but with errors."
|
---|
48 | rc=1
|
---|
49 | else
|
---|
50 | if test "$1" != "--srv4"; then
|
---|
51 | echo "Post installation completed successfully!"
|
---|
52 | fi
|
---|
53 | fi
|
---|
54 | else
|
---|
55 | echo 1>&2 "## ERROR!! Failed to remove older/partially installed bits."
|
---|
56 | rc=1
|
---|
57 | fi
|
---|
58 |
|
---|
59 | exit "$rc"
|
---|
60 |
|
---|