[PATCH 4/4] kexec/fs2dt: check for /chosen/stdout-path first

Andrew Jones drjones at redhat.com
Fri Nov 20 09:31:54 PST 2015


Check /chosen/stdout-path first, as linux,stdout-path is deprecated.
I don't know how the ppc64:my_debug thing works, but on arm the warning
"Unable to find /proc/device-tree//chosen/linux,stdout-path, printing
from purgatory is diabled" is output when loading a kexec kernel. This
patch at least suppresses that when /chosen/stdout-path exists, and
maybe it even enables printing from purgatory?

Signed-off-by: Andrew Jones <drjones at redhat.com>
---
 kexec/fs2dt.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c
index affee57b9bb62..b3c209b871a15 100644
--- a/kexec/fs2dt.c
+++ b/kexec/fs2dt.c
@@ -656,12 +656,16 @@ static void putnode(void)
 		 * code can print 'I'm in purgatory' message. Currently only
 		 * pseries/hvcterminal is supported.
 		 */
-		snprintf(filename, MAXPATH, "%slinux,stdout-path", pathname);
+		snprintf(filename, MAXPATH, "%sstdout-path", pathname);
 		fd = open(filename, O_RDONLY);
 		if (fd == -1) {
-			printf("Unable to find %s, printing from purgatory is disabled\n",
-														filename);
-			goto no_debug;
+			snprintf(filename, MAXPATH, "%slinux,stdout-path", pathname);
+			fd = open(filename, O_RDONLY);
+			if (fd == -1) {
+				printf("Unable to find %s[linux,]stdout-path, printing from purgatory is disabled\n",
+														pathname);
+				goto no_debug;
+			}
 		}
 		if (fstat(fd, &statbuf)) {
 			printf("Unable to stat %s, printing from purgatory is disabled\n",
-- 
2.4.3




More information about the kexec mailing list