[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v2 07/20] ts-host-install: Add option to boot debian-installer in rescue mode



This is useful when trying to bootstrap onto a new platform, since you can log
in to an otherwise unbootable rootfs to figure out what is going wrong.

The procedure is the same as installing except "rescue/enabled=true" is added
to the command line, hence part of ts-host-install rather than separate.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/Debian.pm | 1 +
 ts-host-install   | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 29dec3b..8f80eb4 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -422,6 +422,7 @@ sub di_installcmdline_core ($$;@) {
     my $debconf_priority= $xopts{DebconfPriority};
     push @cl, "debconf/priority=$debconf_priority"
         if defined $debconf_priority;
+    push @cl, "rescue/enable=true" if $xopts{RescueMode};
 
     return @cl;
 }
diff --git a/ts-host-install b/ts-host-install
index c611ed1..2f72b5f 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -30,9 +30,14 @@ my $debconf_priority;
 
 our %xopts;
 
-if (@ARGV && $ARGV[0] =~ m/^--priority(?:=(.*))?$/) {
+while (@ARGV and $ARGV[0] =~ m/^-/) {
+    $_= shift @ARGV;
+    last if m/^--$/;
+    if (m/^--priority(?:=(.*))?$/) {
     $xopts{DebconfPriority}= defined($1) ? $1 : 'low';
-    shift @ARGV;
+    } elsif  (m/^--rescue$/) {
+       $xopts{RescueMode}= 1;
+    }
 }
 
 our ($whhost) = @ARGV;
-- 
2.1.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.