blob: 56f7933d4308f2d91ad0b8f498bf0d642a7473df [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
21}
22