From 0a8343be664bf4af0ec56df9daa7e30b999fe61b Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 17 Feb 2024 02:16:20 +0100 Subject: [PATCH] pkgs/kernel/uimage: introduce `commandLineDtbNode` Certain devices like the Zyxel NWA50AX will pass information on the command-line to explain what is the current image (`bootImage=1` vs. `bootImage=0`). Unfortunately, if we set the `chosen/bootargs` node, this will be overridden forcibly by U-Boot. To avoid this problem, it's easier to simply just use another DTB node like `bootargs-override` which is what OpenWRT does [1]. [1]: https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ramips/patches-5.15/314-MIPS-add-bootargs-override-property.patch;h=e7dca7af886e8c0b69ba2b23f5855ddfeeb0d4a1;hb=refs/heads/main Signed-off-by: Raito Bezarius --- pkgs/kernel/uimage.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/kernel/uimage.nix b/pkgs/kernel/uimage.nix index eca50d5..83d9031 100644 --- a/pkgs/kernel/uimage.nix +++ b/pkgs/kernel/uimage.nix @@ -15,6 +15,7 @@ let in { kernel , commandLine +, commandLineDtbNode ? "bootargs" , entryPoint , extraName ? "" # e.g. socFamily , loadAddress @@ -39,7 +40,7 @@ in { ''; mungeDtbPhase = '' dtc -I dtb -O dts -o tmp.dts ${dtb} - echo '/{ chosen { bootargs = ${builtins.toJSON commandLine}; }; };' >> tmp.dts + echo '/{ chosen { ${commandLineDtbNode} = ${builtins.toJSON commandLine}; }; };' >> tmp.dts dtc -I dts -O dtb -o tmp.dtb tmp.dts '';