Bug#569033: initramfs-tools: Please make the panic argument available in the rescue shell
Package: initramfs-tools
Version: 0.93.4
Severity: wishlist
Tags: patch
Hi,
Sometimes one misses the error message printed by the panic helper function,
for example when attaching a serial console after the fact, or if kernel
messages resulting from udev activity obscure or scroll it away.
Please consider adding some facility like the attached patch.
Thanks,
Feri.
>From 2350475dbbf10aced5c10993e3bdcc25c3fddceb Mon Sep 17 00:00:00 2001
From: Ferenc Wagner <wferi@niif.hu>
Date: Tue, 9 Feb 2010 17:02:35 +0100
Subject: [PATCH] Export $REASON to the emergency shell spawned by the panic helper function
---
initramfs-tools.8 | 4 ++++
scripts/functions | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/initramfs-tools.8 b/initramfs-tools.8
index 2ba022a..55d413a 100644
--- a/initramfs-tools.8
+++ b/initramfs-tools.8
@@ -504,6 +504,10 @@ set according relevant boot option.
\fB\fI break
Useful for manual intervention during setup and coding an boot script.
.TP
+\fB\fI REASON
+Argument passed to the \fIpanic\fP helper function. Use to find out why
+you landed in the initramfs shell.
+.TP
\fB\fI init
passes the path to init(8) usually /sbin/init.
.TP
diff --git a/scripts/functions b/scripts/functions
index 77de8f3..c34dd4a 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -50,7 +50,7 @@ panic()
modprobe i8042
modprobe atkbd
echo $@
- PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
+ REASON="$@" PS1='(initramfs) ' /bin/sh -i </dev/console >/dev/console 2>&1
}
maybe_break()
--
1.5.6.5
Reply to: