Dear Maintainer,

Per Ian's confirmation, enclosed the updated patchset.
1st patch is not touched, only some commit log change in 2nd patch.
Thank you!

Cheers,
Roger
From 28ed0a7df830882641c0984bf78b442b120f822d Mon Sep 17 00:00:00 2001
From: Roger Shimizu <rogershim...@gmail.com>
Date: Mon, 27 Jul 2015 22:19:20 +0900
Subject: [PATCH v2 1/2] advance the timing of insmod netconsole

Insmod netconsole before calling "load_modules" routine, which loads
all specified modules. Because "load_modules" merely uses the module
param in /etc/initramfs-tools/modules.
This makes it possible to set netconsole param in command line options.

Signed-off-by: Roger Shimizu <rogershim...@gmail.com>
---
 init | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/init b/init
index abf7f25..0497c67 100755
--- a/init
+++ b/init
@@ -200,11 +200,10 @@ run_scripts /scripts/init-top
 
 maybe_break modules
 [ "$quiet" != "y" ] && log_begin_msg "Loading essential drivers"
+[ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}"
 load_modules
 [ "$quiet" != "y" ] && log_end_msg
 
-[ -n "${netconsole}" ] && modprobe netconsole netconsole="${netconsole}"
-
 maybe_break premount
 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
 run_scripts /scripts/init-premount
-- 
2.1.4

From e6d24023b7d712009fed933ce5dc266e2aec6289 Mon Sep 17 00:00:00 2001
From: Roger Shimizu <rogershim...@gmail.com>
Date: Sat, 1 Aug 2015 01:58:48 +0900
Subject: [PATCH v2 2/2] redirect debug info to netconsole

Redirect if debug and netconsole are both set in command line options.
The redirecting code is added in both debug and netconsole entry to
make the redirection as early as possible.
Debug info saving to file feature is still available if 'debug' is set
but 'netconsole' is not set in command line options.

Original idea was from Ian's post:
http://www.hellion.org.uk/blog/posts/debugging-initramfs-over-netconsole/

Signed-off-by: Roger Shimizu <rogershim...@gmail.com>
Signed-off-by: Ian Campbell <i...@debian.org>
---
 init | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/init b/init
index 0497c67..96f1635 100755
--- a/init
+++ b/init
@@ -146,7 +146,11 @@ for x in $(cat /proc/cmdline); do
 	debug)
 		debug=y
 		quiet=n
-		exec >/run/initramfs/initramfs.debug 2>&1
+		if [ -n "${netconsole}" ]; then
+			exec >/dev/kmsg 2>&1
+		else
+			exec >/run/initramfs/initramfs.debug 2>&1
+		fi
 		set -x
 		;;
 	debug=*)
@@ -165,6 +169,7 @@ for x in $(cat /proc/cmdline); do
 		;;
 	netconsole=*)
 		netconsole=${x#netconsole=}
+		[ "x$debug" = "xy" ] && exec >/dev/kmsg 2>&1
 		;;
 	BOOTIF=*)
 		BOOTIF=${x#BOOTIF=}
-- 
2.1.4

Reply via email to