meta-google: phosphor-ipmi-config: ensure gbmcbr access available

Ensure channel_access for gbmcbr is set as well.

Tested:
Checked the channel access for gbmcbr and it's always available.
```
$ ipmitool channel info 11
Channel 0xb info:
  Channel Medium Type   : 802.3 LAN
  Channel Protocol Type : IPMB-1.0
  Session Support       : multi-session
  Active Session Count  : 0
  Protocol Vendor ID    : 7154
  Volatile(active) Settings
    Alerting            : enabled
    Per-message Auth    : enabled
    User Level Auth     : enabled
    Access Mode         : always available
  Non-Volatile Settings
    Alerting            : enabled
    Per-message Auth    : enabled
    User Level Auth     : enabled
    Access Mode         : always available
```

Signed-off-by: Tom Tung <shes050117@gmail.com>
Change-Id: If385b63fe15f35cc72b6863fea5f3172ef08bc8a
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
index 58997ee..2f2d9e0 100644
--- a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
+++ b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -1,6 +1,9 @@
 FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:"
 
-SRC_URI:append:gbmc = " file://gbmc_bridge.json"
+SRC_URI:append:gbmc = " \
+  file://gbmc_bridge_config.json \
+  file://gbmc_bridge_access.json \
+"
 
 DEPENDS:append:gbmc = " jq-native"
 
@@ -10,16 +13,27 @@
 
 # Replace a channel in config.json to add gbmcbr reporting
 do_install:append:gbmc() {
-  chjson=${D}${datadir}/ipmi-providers/channel_config.json
-  overlapping="$(jq '."${GBMCBR_IPMI_CHANNEL}" | .is_valid and .name != "gbmcbr"' $chjson)"
+  config_json=${D}${datadir}/ipmi-providers/channel_config.json
+  overlapping="$(jq '."${GBMCBR_IPMI_CHANNEL}" | .is_valid and .name != "gbmcbr"' $config_json)"
   if [ "$overlapping" != "false" ]; then
     echo "gBMC channel config overlaps on ${GBMCBR_IPMI_CHANNEL}" >&2
-    cat $chjson
+    cat $config_json
     exit 1
   fi
-  jq --slurpfile brcfg ${WORKDIR}/gbmc_bridge.json \
-    '. + {"${GBMCBR_IPMI_CHANNEL}": $brcfg[0]}' $chjson >${WORKDIR}/tmp
-  mv ${WORKDIR}/tmp $chjson
+  jq --slurpfile brcfg ${WORKDIR}/gbmc_bridge_config.json \
+    '. + {"${GBMCBR_IPMI_CHANNEL}": $brcfg[0]}' $config_json >${WORKDIR}/tmp
+  mv ${WORKDIR}/tmp $config_json
+
+  access_json=${D}${datadir}/ipmi-providers/channel_access.json
+  overlapping="$(jq '."${GBMCBR_IPMI_CHANNEL}" | .access_mode and .access_mode != "always_available"' $access_json)"
+  if [ "$overlapping" != "false" ]; then
+    echo "gBMC channel access overlaps on ${GBMCBR_IPMI_CHANNEL}" >&2
+    cat $access_json
+    exit 1
+  fi
+  jq --slurpfile brcfg ${WORKDIR}/gbmc_bridge_access.json \
+    '. + {"${GBMCBR_IPMI_CHANNEL}": $brcfg[0]}' $access_json >${WORKDIR}/tmp
+  mv ${WORKDIR}/tmp $access_json
 
   # Set entity-map.json to empty json for gBMC by default.
   # Each system will override it if needed.
@@ -27,4 +41,3 @@
     echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json
   fi
 }
-
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge_access.json b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge_access.json
new file mode 100644
index 0000000..b7893b7
--- /dev/null
+++ b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge_access.json
@@ -0,0 +1,7 @@
+{
+  "access_mode": "always_available",
+  "user_auth_disabled": false,
+  "per_msg_auth_disabled": false,
+  "alerting_disabled": false,
+  "priv_limit": "priv-admin"
+}
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge.json b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge_config.json
similarity index 100%
rename from meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge.json
rename to meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config/gbmc_bridge_config.json