blob: 58997eedc17a041b70bff1b83fe5706fa14a96b7 [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
Willy Tu1da83062022-04-07 23:48:56 -07009ENTITY_MAPPING ?= "default"
10
William A. Kennington III97b47e02021-07-15 16:23:01 -070011# Replace a channel in config.json to add gbmcbr reporting
Willy Tu4dd03ca2021-08-06 09:37:35 -070012do_install:append:gbmc() {
William A. Kennington III97b47e02021-07-15 16:23:01 -070013 chjson=${D}${datadir}/ipmi-providers/channel_config.json
14 overlapping="$(jq '."${GBMCBR_IPMI_CHANNEL}" | .is_valid and .name != "gbmcbr"' $chjson)"
15 if [ "$overlapping" != "false" ]; then
16 echo "gBMC channel config overlaps on ${GBMCBR_IPMI_CHANNEL}" >&2
17 cat $chjson
18 exit 1
19 fi
20 jq --slurpfile brcfg ${WORKDIR}/gbmc_bridge.json \
21 '. + {"${GBMCBR_IPMI_CHANNEL}": $brcfg[0]}' $chjson >${WORKDIR}/tmp
22 mv ${WORKDIR}/tmp $chjson
Willy Tuc93f10b2022-03-28 11:18:53 -070023
24 # Set entity-map.json to empty json for gBMC by default.
25 # Each system will override it if needed.
Willy Tu1da83062022-04-07 23:48:56 -070026 if [[ "${ENTITY_MAPPING}" != "default" ]]; then
27 echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
28 fi
William A. Kennington III97b47e02021-07-15 16:23:01 -070029}
30