920-device_tree_cmdline.patch 872 B

12345678910111213141516171819202122232425
  1. From e08bcbbaa52fcc41f02743fd2e62a33255ce52da Mon Sep 17 00:00:00 2001
  2. From: OpenWrt community <[email protected]>
  3. Date: Wed, 13 Jul 2022 13:52:28 +0200
  4. Subject: [PATCH] of/ftd: add device tree cmdline
  5. ---
  6. drivers/of/fdt.c | 3 +++
  7. 1 file changed, 3 insertions(+)
  8. diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
  9. index 59a7a9ee58ef..3b0b62b410dd 100644
  10. --- a/drivers/of/fdt.c
  11. +++ b/drivers/of/fdt.c
  12. @@ -1158,6 +1158,9 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
  13. p = of_get_flat_dt_prop(node, "bootargs", &l);
  14. if (p != NULL && l > 0)
  15. strlcpy(data, p, min(l, COMMAND_LINE_SIZE));
  16. + p = of_get_flat_dt_prop(node, "bootargs-append", &l);
  17. + if (p != NULL && l > 0)
  18. + strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));
  19. /*
  20. * CONFIG_CMDLINE is meant to be a default in case nothing else
  21. --