]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-host-install: Add option to boot debian-installer in rescue mode
authorIan Campbell <ian.campbell@citrix.com>
Wed, 29 Oct 2014 10:41:29 +0000 (10:41 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 29 Oct 2014 16:49:14 +0000 (16:49 +0000)
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@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
ts-host-install

index 29dec3b462990c18e82105bd95d2537cc47189ec..8f80eb4b6f6f54fbb275771c73be048cbcecb2a3 100644 (file)
@@ -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;
 }
index c611ed145a02135a84524ff9547c7eaf44750556..2f72b5faba51db30def5ab01e4cace482922d719 100755 (executable)
@@ -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;