[Ovirt-devel] [PATCH node] add rescue mode
Alan Pevec
apevec at redhat.com
Wed Apr 29 17:51:42 UTC 2009
Append "rescue" boot parameter to invoke an emergency shell early in the
boot process, right after the persistent configuration is mounted.
This can be used for debugging and fixing configuration issues.
Signed-off-by: Alan Pevec <apevec at redhat.com>
---
scripts/ovirt-early | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index bc0f58d..ac54e4b 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -134,6 +134,7 @@ start() {
# ovirt_local_boot
# ovirt_standalone
# ovirt_firstboot
+ # rescue
# pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
# anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip>
# ipv6=dhcp|auto
@@ -194,6 +195,10 @@ start() {
# in auto-install mode, overwrite the disk chosen by ovirt_init parameter
firstboot=
+ # rescue
+ # enter emergency shell for fixing configuration issues
+ rescue=
+
# pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
# anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip>
# ipv6=dhcp|auto
@@ -304,6 +309,9 @@ start() {
ovirt_firstboot*)
firstboot=1
;;
+ rescue)
+ rescue=1
+ ;;
ovirt_overcommit*)
i=${i#ovirt_overcommit=}
@@ -378,6 +386,15 @@ start() {
fi
fi
+ if [ "$rescue" = 1 ]; then
+ log "Rescue mode requested, starting emergency shell"
+ stop_log
+ plymouth --hide-splash
+ bash < /dev/console
+ plymouth --show-splash
+ start_log
+ fi
+
if [ "$standalone" = 1 ]; then
# In standalone mode, fix libvirt to not use gssapi
sed -c -i -e s/^keytab/#keytab/ \
@@ -436,10 +453,12 @@ case "$1" in
printf "Starting ovirt-early: "
{
+ start_log
log "Starting ovirt-early"
start
log "Completed ovirt-early"
- } >> $OVIRT_LOGFILE 2>&1
+ stop_log
+ }
test $? == 0 && success || failure
echo
--
1.6.0.6
More information about the ovirt-devel
mailing list