meta-google: ipmi-config: Add option to remove default entity config
Currently it fources all gBMC to have `[]` as the entity-mapping config
and will cause an issue to gBMC systems that uses the default mapping.
Add a way to remove the default isntead of having all gBMC automatically
remove it.
ENTITY_MAPPING="default"
```
$ cat ./tmp/work/all-openbmc-linux/phosphor-ipmi-config/1.0-r1/package/usr/share/ipmi-providers/entity-map.json
[
{
"id": 0,
"containerEntityId": 30,
"containerEntityInstance": 0,
"isList": false,
"isLinked": false,
"entities": [
{
"id": 11,
"instance": 3
},
{
"id": 11,
...
```
ENTITY_MAPPING="no"
```
$ cat ./tmp/work/all-openbmc-linux/phosphor-ipmi-config/1.0-r1/package/usr/share/ipmi-providers/entity-map.json
[]
```
Change-Id: I9adccc2685055bad8ac27207305083ba40327ce2
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
index aa2e266..58997ee 100644
--- a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
+++ b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -6,6 +6,8 @@
GBMCBR_IPMI_CHANNEL ?= "11"
+ENTITY_MAPPING ?= "default"
+
# Replace a channel in config.json to add gbmcbr reporting
do_install:append:gbmc() {
chjson=${D}${datadir}/ipmi-providers/channel_config.json
@@ -21,6 +23,8 @@
# Set entity-map.json to empty json for gBMC by default.
# Each system will override it if needed.
- echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
+ if [[ "${ENTITY_MAPPING}" != "default" ]]; then
+ echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
+ fi
}