From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 07/20] ts-host-install: Add option to boot debian-installer in rescue mode Date: Wed, 29 Oct 2014 10:41:29 +0000 Message-ID: <1414579302-6692-7-git-send-email-ian.campbell@citrix.com> References: <1414579268.29975.13.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1414579268.29975.13.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 Acked-by: Ian Jackson --- 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