920-device_tree_cmdline.patch 1.0 KB

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