summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-02 15:20:29 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-03-07 16:24:31 +1100
commit526d4b3d959d3d108f38f35dae0855a29692a069 (patch)
tree040aae6c2de67b23d9a11d60b0757e391ab15711
parente6407ab0ae617fe415ff8d1c1c2116d6931a6131 (diff)
downloadtalos-petitboot-526d4b3d959d3d108f38f35dae0855a29692a069.tar.gz
talos-petitboot-526d4b3d959d3d108f38f35dae0855a29692a069.zip
utils/hooks: Set stdout-path property
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@mendozajonas.com>
-rw-r--r--utils/hooks/30-dtb-updates.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/utils/hooks/30-dtb-updates.c b/utils/hooks/30-dtb-updates.c
index f7de976..b8413fd 100644
--- a/utils/hooks/30-dtb-updates.c
+++ b/utils/hooks/30-dtb-updates.c
@@ -502,9 +502,8 @@ static int set_stdout(struct offb_ctx *ctx)
{
const char *boot_console, *ptr;
long unsigned int termno;
- const fdt32_t *prop;
- int node, prop_len;
char *stdout_path;
+ int node;
boot_console = getenv("boot_console");
if (!boot_console) {
@@ -554,12 +553,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);
OpenPOWER on IntegriCloud