Bug#585897: initramfs-tools: allow multiple break points
Package: initramfs-tools
Version: 0.96.1
Severity: wishlist
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch maverick
This patch is a rebased version of one from Evan Dandrea (CCed), and
allows specifying multiple break points using a comma delimiter. This
is sometimes convenient when debugging the initramfs. I added some
brief documentation.
diff --git a/initramfs-tools.8 b/initramfs-tools.8
index fd00429..7d95709 100644
--- a/initramfs-tools.8
+++ b/initramfs-tools.8
@@ -124,6 +124,7 @@ spawns a shell in the initramfs image at chosen run-time
The default is premount without any arg.
Beware that if both "panic" and "break" are present,
initramfs will not spawn any shells but reboot instead.
+Multiple break points may be given, separated by commas.
.TP
\fB\fI netconsole
diff --git a/scripts/functions b/scripts/functions
index 685642e..89451c7 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -55,7 +55,7 @@ panic()
maybe_break()
{
- if [ "${break:-}" = "$1" ]; then
+ if echo "${break:-}" | egrep -q "(,|^)$1(,|$)"; then
panic "Spawning shell within the initramfs"
fi
}
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
Reply to: