Skip to content

Commit

Permalink
utils/hooks: Set stdout-path property
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sammj committed Mar 7, 2018
1 parent e6407ab commit 526d4b3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions utils/hooks/30-dtb-updates.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 526d4b3

Please sign in to comment.