3 # ovirt-firstboot Puts the node into configuration mode.
5 # chkconfig: 2345 99 01
6 # description: ovirt-firstboot node configuration script
8 # Copyright (C) 2008 Red Hat, Inc.
9 # Written by Darryl L. Pierce <dpierce@redhat.com>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 # MA 02110-1301, USA. A copy of the GNU General Public License is
24 # also available at http://www.gnu.org/copyleft/gpl.html.
26 ## Source functions library
27 .
/etc
/init.d
/functions
28 .
/usr
/libexec
/ovirt-functions
31 VAR_SUBSYS_OVIRT_FIRSTBOOT
=/var
/lock
/subsys
/$prog
33 trap '__st=$?; stop_log; exit $__st' 0
34 trap 'exit $?' 1 2 13 15
37 if [ -e "/dev/HostVG/Root" ]; then
39 log
" Major version upgrades are not allowed."
40 log
" Please uninstall existing version and reinstall."
41 log
" Press Enter to drop to emergency shell."
47 start_ovirt_firstboot
()
50 if ! is_firstboot
&& ! is_auto_install
&& ! is_upgrade
&& ! is_install
; then
54 touch $VAR_SUBSYS_OVIRT_FIRSTBOOT
55 /sbin
/restorecon
-e /var
/lib
/stateless
/writable
-e /data
-e /config
-e /proc
-e /sys
-rv / >> $OVIRT_TMP_LOGFILE 2>&1
57 # Hide kernel messages on the console
62 if [ "$auto_install" = "0" ]; then
63 /usr
/libexec
/ovirt-auto-install
66 if [ -f $OVIRT_TMP_LOGFILE ]; then
67 cat $OVIRT_TMP_LOGFILE >> $OVIRT_LOGFILE
68 rm -f $OVIRT_TMP_LOGFILE
70 if [ $rc -ne 0 ]; then
73 elif [ "$auto_install" = "2" ]; then
74 echo "Device specified in storage_init does not exist"
79 plymouth
--hide-splash
82 # auto install covers this already
83 if ! is_auto_install
; then
84 /usr
/libexec
/ovirt-config-boot
/live
"$OVIRT_BOOTPARAMS" no
90 ovirt_store_firstboot_config || autoinstall_failed
98 if is_firstboot || is_install
; then
99 plymouth
--hide-splash
101 export LVM_SUPPRESS_FD_WARNINGS
=0
102 /usr
/libexec
/ovirt-config-installer
-x < /dev
/console
104 plymouth
--show-splash
108 ovirt_store_firstboot_config
>> $OVIRT_LOGFILE 2>&1
110 rm -f $VAR_SUBSYS_OVIRT_FIRSTBOOT
113 stop_ovirt_firstboot
() {
114 echo -n "Stopping ovirt-firstboot: "
118 reload_ovirt_firstboot
() {
120 start_ovirt_firstboot
129 printf "Starting ovirt-firstboot: "
131 start_ovirt_firstboot
133 test $?
== 0 && success || failure
140 reload_ovirt_firstboot
146 echo "Usage: ovirt-firstboot {start}"