VirtualBox

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

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

Installer/linux: correct getting the script path and admit that we fail on trailing new-lines.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 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# Put bits of the post-installation here which should work the same for all of
16# the Linux installers. We do not use special helpers (e.g. dh_* on Debian),
17# but that should not matter, as we know what those helpers actually do, and we
18# have to work on those systems anyway when installed using the all
19# distributions installer.
20#
21# We assume that all required files are in the same folder as this script
22# (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
23
24# This is GNU-specific, sorry Solaris. It fails on directories ending in '\n'.
25MY_PATH="$(dirname $(readlink -f -- "${0}"))"
26cd "${MY_PATH}"
27. "./routines.sh"
28
29START=true
30TARGET="${MY_PATH}"
31while test -n "${1}"; do
32 case "${1}" in
33 --nostart)
34 START=
35 ;;
36 *)
37 echo "Bad argument ${1}" >&2
38 exit 1
39 ;;
40 esac
41 shift
42done
43
44# Remove any traces of DKMS from previous installations.
45for i in vboxhost vboxdrv vboxnetflt vboxnetadp; do
46 rm -rf "/var/lib/dkms/${i}"*
47done
48
49# Install runlevel scripts and systemd unit files
50install_init_script "${TARGET}/vboxdrv.sh" vboxdrv
51install_init_script "${TARGET}/vboxballoonctrl-service.sh" vboxballoonctrl-service
52install_init_script "${TARGET}/vboxautostart-service.sh" vboxautostart-service
53install_init_script "${TARGET}/vboxweb-service.sh" vboxweb-service
54
55delrunlevel vboxdrv
56addrunlevel vboxdrv
57delrunlevel vboxballoonctrl-service
58addrunlevel vboxballoonctrl-service
59delrunlevel vboxautostart-service
60addrunlevel vboxautostart-service
61delrunlevel vboxweb-service
62addrunlevel vboxweb-service
63
64ln -sf "${MY_PATH}/postinst-common.sh" /sbin/vboxconfig
65
66test -n "${START}" &&
67{
68 start_init_script vboxdrv
69 start_init_script vboxballoonctrl-service
70 start_init_script vboxautostart-service
71 start_init_script vboxweb-service
72}
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