dbba45b41c3b3a87c3644971f46b6ff8a319fa3f
[openwrt/openwrt.git] / target / linux / generic / hack-5.10 / 920-device_tree_cmdline.patch
1 From a9968d9cb8cb10030491fa05e24b00bd42f6d3a9 Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@openwrt.org>
3 Date: Thu, 30 May 2013 16:00:42 +0000
4 Subject: fdt: enable retrieving kernel args from bootloader
5
6 This patch is a device tree enhancement that IMHO is worthy of mainline.
7 It allows the bootloader's commandline to be preserved even when the
8 device tree specifies one.
9
10 Submitted-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
11
12 SVN-Revision: 36780
13 ---
14 drivers/of/fdt.c | 3 +++
15 1 file changed, 3 insertions(+)
16
17 --- a/drivers/of/fdt.c
18 +++ b/drivers/of/fdt.c
19 @@ -1054,6 +1054,9 @@ int __init early_init_dt_scan_chosen(uns
20 p = of_get_flat_dt_prop(node, "bootargs", &l);
21 if (p != NULL && l > 0)
22 strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
23 + p = of_get_flat_dt_prop(node, "bootargs-append", &l);
24 + if (p != NULL && l > 0)
25 + strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));
26
27 /*
28 * CONFIG_CMDLINE is meant to be a default in case nothing else