blob: aa2e2667187f064ed25e61d4811459527d265982 [file] [log] [blame]
Willy Tu4dd03ca2021-08-06 09:37:35 -07001FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:"
William A. Kennington III97b47e02021-07-15 16:23:01 -07002
Willy Tu4dd03ca2021-08-06 09:37:35 -07003SRC_URI:append:gbmc = " file://gbmc_bridge.json"
William A. Kennington III97b47e02021-07-15 16:23:01 -07004
Willy Tu4dd03ca2021-08-06 09:37:35 -07005DEPENDS:append:gbmc = " jq-native"
William A. Kennington III97b47e02021-07-15 16:23:01 -07006
7GBMCBR_IPMI_CHANNEL ?= "11"
8
9# Replace a channel in config.json to add gbmcbr reporting
Willy Tu4dd03ca2021-08-06 09:37:35 -070010do_install:append:gbmc() {
William A. Kennington III97b47e02021-07-15 16:23:01 -070011 chjson=${D}${datadir}/ipmi-providers/channel_config.json
12 overlapping="$(jq '."${GBMCBR_IPMI_CHANNEL}" | .is_valid and .name != "gbmcbr"' $chjson)"
13 if [ "$overlapping" != "false" ]; then
14 echo "gBMC channel config overlaps on ${GBMCBR_IPMI_CHANNEL}" >&2
15 cat $chjson
16 exit 1
17 fi
18 jq --slurpfile brcfg ${WORKDIR}/gbmc_bridge.json \
19 '. + {"${GBMCBR_IPMI_CHANNEL}": $brcfg[0]}' $chjson >${WORKDIR}/tmp
20 mv ${WORKDIR}/tmp $chjson
Willy Tuc93f10b2022-03-28 11:18:53 -070021
22 # Set entity-map.json to empty json for gBMC by default.
23 # Each system will override it if needed.
24 echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
William A. Kennington III97b47e02021-07-15 16:23:01 -070025}
26