From 4580c372000b469c4292e548c806dfe5922e97d1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 20 Nov 2015 12:31:54 -0500 Subject: kexec/fs2dt: check for /chosen/stdout-path first 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 Signed-off-by: Simon Horman --- kexec/fs2dt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c index affee57..b3c209b 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", -- cgit