blob: 03e99b2d07feb91f4599e51e989d5d232e5d0aa7 [file] [log] [blame]
William A. Kennington III97b47e02021-07-15 16:23:01 -07001FILESEXTRAPATHS_prepend_gbmc := "${THISDIR}/${PN}:"
2
3SRC_URI_append_gbmc = " file://gbmc_bridge.json"
4
5DEPENDS_append_gbmc = " jq-native"
6
7GBMCBR_IPMI_CHANNEL ?= "11"
8
9# Replace a channel in config.json to add gbmcbr reporting
10do_install_append_gbmc() {
11 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
21}
22