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 <richard@bit42.se>
This commit is contained in:
Richard Alpe
2023-05-25 08:24:31 +02:00
committed by Joachim Wiberg
parent d4333e1a8d
commit f56ca0d0ca
+2 -1
View File
@@ -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.