VirtualBox

source: vbox/trunk/src/VBox/Main/UnattendedTemplates/redhat_postinstall.sh@ 68071

Last change on this file since 68071 was 68071, checked in by vboxsync, 8 years ago

Unattended: Split out the post installation script into a separate file. Dropped the IUnattended::loadSettings method, don't see much point. Simplified the script editor classes, moving the default filenames and templates to the installer constructor, allowing us to avoid having to 'new' the script editors. The editors are now direct members of UnattendedInstaller.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1#!/bin/bash
2## @file
3# Post installation script template for redhat-like distros.
4#
5# This script expects to be running chroot'ed into /target.
6#
7
8#
9# Copyright (C) 2017 Oracle Corporation
10#
11# This file is part of VirtualBox Open Source Edition (OSE), as
12# available from http://www.virtualbox.org. This file is free software;
13# you can redistribute it and/or modify it under the terms of the GNU
14# General Public License (GPL) as published by the Free Software
15# Foundation, in version 2 as it comes in the "COPYING" file of the
16# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18#
19
20MY_LOGFILE="/var/log/vboxpostinstall.log"
21MY_EXITCODE=0
22
23# Logs execution of a command.
24log_command()
25{
26 echo "Executing: $*" >> "${MY_LOGFILE}"
27 "$@" 2>&1 | tee -a "${MY_LOGFILE}"
28 if [ "${PIPESTATUS[0]}" != "0" ]; then
29 echo "exit code: ${PIPESTATUS[0]}"
30 MY_EXITCODE=1;
31 fi
32}
33
34
35echo "Started: $*" >> "${MY_LOGFILE}"
36echo "Date: `date -R`" >> "${MY_LOGFILE}"
37
38#echo ''
39#echo 'Installing packages for building kernel modules...'
40#log_command apt-get -y install build-essential
41#log_command apt-get -y install linux-headers-$(uname -r)
42#
43
44@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
45echo ''
46echo 'Installing VirtualBox Guest Additions...'
47## @todo fix this
48log_command /bin/bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run
49log_command usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"
50@@VBOX_COND_END@@
51
52@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@
53echo ''
54echo 'Installing Test Execution Service...'
55## @todo fix this
56@@VBOX_COND_END@@
57
58echo "Final exit code: ${MY_EXITCODE}" >> "${MY_LOGFILE}"
59exit ${MY_EXITCODE}
60
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