VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/postinst-common.sh@ 59083

Last change on this file since 59083 was 58399, checked in by vboxsync, 9 years ago

#8051: Installers: unify Linux host installers as far as possible: since we stopped inserting the common script code containing set_selinux_permissions() into VirtualBox.tmpl that function was no longer called. Move it to postinst-common.sh instead, and remove it from routines.sh and the .run installer.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1# Oracle VM VirtualBox
2# VirtualBox Linux post-installer common portions
3#
4
5# Copyright (C) 2015 Oracle Corporation
6#
7# This file is part of VirtualBox Open Source Edition (OSE), as
8# available from http://www.virtualbox.org. This file is free software;
9# you can redistribute it and/or modify it under the terms of the GNU
10# General Public License (GPL) as published by the Free Software
11# Foundation, in version 2 as it comes in the "COPYING" file of the
12# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14#
15
16# Put bits of the post-installation here which should work the same for all of
17# the Linux installers. We do not use special helpers (e.g. dh_* on Debian),
18# but that should not matter, as we know what those helpers actually do, and we
19# have to work on those systems anyway when installed using the all
20# distributions installer.
21#
22# We assume that all required files are in the same folder as this script
23# (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
24
25# The below is GNU-specific. See VBox.sh for the longer Solaris/OS X version.
26TARGET=`readlink -e -- "${0}"` || exit 1
27MY_PATH="${TARGET%/[!/]*}"
28cd "${MY_PATH}"
29. "./routines.sh"
30
31START=true
32while test -n "${1}"; do
33 case "${1}" in
34 --nostart)
35 START=
36 ;;
37 *)
38 echo "Bad argument ${1}" >&2
39 exit 1
40 ;;
41 esac
42 shift
43done
44
45# Remove any traces of DKMS from previous installations.
46for i in vboxhost vboxdrv vboxnetflt vboxnetadp; do
47 rm -rf "/var/lib/dkms/${i}"*
48done
49
50# Install runlevel scripts and systemd unit files
51install_init_script "${MY_PATH}/vboxdrv.sh" vboxdrv
52install_init_script "${MY_PATH}/vboxballoonctrl-service.sh" vboxballoonctrl-service
53install_init_script "${MY_PATH}/vboxautostart-service.sh" vboxautostart-service
54install_init_script "${MY_PATH}/vboxweb-service.sh" vboxweb-service
55
56delrunlevel vboxdrv
57addrunlevel vboxdrv
58delrunlevel vboxballoonctrl-service
59addrunlevel vboxballoonctrl-service
60delrunlevel vboxautostart-service
61addrunlevel vboxautostart-service
62delrunlevel vboxweb-service
63addrunlevel vboxweb-service
64
65ln -sf "${MY_PATH}/postinst-common.sh" /sbin/vboxconfig
66
67# Set SELinux permissions
68# XXX SELinux: allow text relocation entries
69if [ -x /usr/bin/chcon ]; then
70 chcon -t texrel_shlib_t "${MY_PATH}"/*VBox* > /dev/null 2>&1
71 chcon -t texrel_shlib_t "${MY_PATH}"/VBoxAuth.so \
72 > /dev/null 2>&1
73 chcon -t texrel_shlib_t "${MY_PATH}"/VirtualBox.so \
74 > /dev/null 2>&1
75 chcon -t texrel_shlib_t "${MY_PATH}"/components/VBox*.so \
76 > /dev/null 2>&1
77 chcon -t java_exec_t "${MY_PATH}"/VirtualBox > /dev/null 2>&1
78 chcon -t java_exec_t "${MY_PATH}"/VBoxSDL > /dev/null 2>&1
79 chcon -t java_exec_t "${MY_PATH}"/VBoxHeadless \
80 > /dev/null 2>&1
81 chcon -t java_exec_t "${MY_PATH}"/VBoxNetDHCP \
82 > /dev/null 2>&1
83 chcon -t java_exec_t "${MY_PATH}"/VBoxNetNAT \
84 > /dev/null 2>&1
85 chcon -t java_exec_t "${MY_PATH}"/VBoxExtPackHelperApp \
86 > /dev/null 2>&1
87 chcon -t java_exec_t "${MY_PATH}"/vboxwebsrv > /dev/null 2>&1
88 chcon -t java_exec_t "${MY_PATH}"/webtest > /dev/null 2>&1
89 chcon -t bin_t "${MY_PATH}"/src/vboxhost/build_in_tmp \
90 > /dev/null 2>&1
91 chcon -t bin_t /usr/share/virtualbox/src/vboxhost/build_in_tmp \
92 > /dev/null 2>&1
93fi
94
95test -n "${START}" &&
96{
97 start_init_script vboxdrv
98 start_init_script vboxballoonctrl-service
99 start_init_script vboxautostart-service
100 start_init_script vboxweb-service
101}
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