From f56ca0d0ca6b06f80da0d69954d16ae772fd82cd Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 23 May 2023 16:48:43 +0200 Subject: [PATCH] confd: fix json merging when generating factory config jq -s 'add' didn't merge data, i.e.: hostname.json: "ietf-system:system": { "hostname": { } } auth.json: "ietf-system:system": { "authentication": { } } Didn't become: "ietf-system:system": { "authentication": { } "hostname": { } } Signed-off-by: Richard Alpe --- board/common/rootfs/lib/infix/cfg-bootstrap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/common/rootfs/lib/infix/cfg-bootstrap b/board/common/rootfs/lib/infix/cfg-bootstrap index 6fe08bc2..caf780ea 100755 --- a/board/common/rootfs/lib/infix/cfg-bootstrap +++ b/board/common/rootfs/lib/infix/cfg-bootstrap @@ -10,7 +10,8 @@ PATH=/lib/infix/factory:$PATH gen-hostname >$FACTORY_D/20-auto-hostname.json gen-interfaces >$FACTORY_D/20-auto-interfaces.json -jq -s add $(find $FACTORY_D -name '*.json') >$CFG_D/auto-factory-config.cfg +jq -s 'reduce .[] as $item ({}; . * $item)' $(find $FACTORY_D -name '*.json') \ + >$CFG_D/auto-factory-config.cfg # TODO: Look for statically defined factory-config, based on the # system's product ID.