[PATCH] utils/hooks: Set stdout-path property

Samuel Mendoza-Jonas sam at mendozajonas.com
Fri Mar 2 15:20:29 AEDT 2018


The linux,stdout-path property was deprecated in favour of stdout-path
in the v3.14 kernel. 'stdout-path' takes priority in newer kernels but
older kernels won't be aware of it, so set both at boot time.

Signed-off-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
---
 utils/hooks/30-dtb-updates.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/utils/hooks/30-dtb-updates.c b/utils/hooks/30-dtb-updates.c
index f7de976..e3f0394 100644
--- a/utils/hooks/30-dtb-updates.c
+++ b/utils/hooks/30-dtb-updates.c
@@ -554,12 +554,12 @@ static int set_stdout(struct offb_ctx *ctx)
 		return -1;
 	}
 
-	prop = fdt_getprop(ctx->dtb, node, "linux,stdout-path", &prop_len);
-	if (!prop) {
-		fprintf(stderr, "Failed to find linux,stdout-path\n");
-		return -1;
-	}
-
+	/*
+	 * linux,stdout-path is deprecated after v3.14 but we don't know
+	 * what the next kernel will be, so set both.
+	 */
+	fdt_set_check(ctx->dtb, node, fdt_setprop_string, "stdout-path",
+			stdout_path);
 	fdt_set_check(ctx->dtb, node, fdt_setprop_string, "linux,stdout-path",
 			stdout_path);
 
-- 
2.16.2



More information about the Petitboot mailing list