Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:" |
William A. Kennington III | 97b47e0 | 2021-07-15 16:23:01 -0700 | [diff] [blame] | 2 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 3 | SRC_URI:append:gbmc = " file://gbmc_bridge.json" |
William A. Kennington III | 97b47e0 | 2021-07-15 16:23:01 -0700 | [diff] [blame] | 4 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 5 | DEPENDS:append:gbmc = " jq-native" |
William A. Kennington III | 97b47e0 | 2021-07-15 16:23:01 -0700 | [diff] [blame] | 6 | |
| 7 | GBMCBR_IPMI_CHANNEL ?= "11" |
| 8 | |
| 9 | # Replace a channel in config.json to add gbmcbr reporting |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 10 | do_install:append:gbmc() { |
William A. Kennington III | 97b47e0 | 2021-07-15 16:23:01 -0700 | [diff] [blame] | 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 | |