William A. Kennington III | 97b47e0 | 2021-07-15 16:23:01 -0700 | [diff] [blame] | 1 | FILESEXTRAPATHS_prepend_gbmc := "${THISDIR}/${PN}:" |
| 2 | |
| 3 | SRC_URI_append_gbmc = " file://gbmc_bridge.json" |
| 4 | |
| 5 | DEPENDS_append_gbmc = " jq-native" |
| 6 | |
| 7 | GBMCBR_IPMI_CHANNEL ?= "11" |
| 8 | |
| 9 | # Replace a channel in config.json to add gbmcbr reporting |
| 10 | do_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 | |