diff options
author | Alvin Wang <alvinwang@msn.com> | 2019-08-28 10:18:15 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-09-12 16:04:26 +0300 |
commit | bca48eae0c40afa729922263645ead4447493193 (patch) | |
tree | f85c13e7bd5fcbac8c4a4b6969cce4bba0bfc42e /meta-openpower/recipes-phosphor/network | |
parent | 12ce8edf406a1f3d58fd9c8db21a46c629d8c6ef (diff) | |
download | openbmc-bca48eae0c40afa729922263645ead4447493193.tar.xz |
Add two MAC addresses support for Mihawk's 2 NICs
(From meta-openpower rev: 94da1d8dee685dbfb062f457597265289d369295)
Change-Id: I0df0ad8b66d8dfc7774bf3af73a08eed26a6d497
Signed-off-by: Alvin Wang <alvinwang@msn.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openpower/recipes-phosphor/network')
-rwxr-xr-x | meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh index 9668ed5f1..cf03b82fc 100755 --- a/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh +++ b/meta-openpower/recipes-phosphor/network/first-boot-set-mac/first-boot-set-mac.sh @@ -15,13 +15,34 @@ sync_mac() { INVENTORY_PATH='/xyz/openbmc_project/inventory' NETWORK_ITEM_IFACE='xyz.openbmc_project.Inventory.Item.NetworkInterface' - NETWORK_ITEM_PATH=$(busctl --no-pager --verbose call \ + # Get the NETWORK ITEM count + NETWORK_ITEM_PATH_COUNT=$(busctl --no-pager --verbose call \ + ${MAPPER_IFACE} \ + ${MAPPER_PATH} \ + ${MAPPER_IFACE} \ + GetSubTree sias \ + ${INVENTORY_PATH} 0 1 ${NETWORK_ITEM_IFACE} \ + 2>/dev/null | grep ${INVENTORY_PATH} | wc -l || true) + + if [ $NETWORK_ITEM_PATH_COUNT -gt 1 ]; then + # If there are more than 2 NETOWRK ITEM and path must contain $1 + # for finding the right NETWORK ITEM + NETWORK_ITEM_PATH=$(busctl --no-pager --verbose call \ + ${MAPPER_IFACE} \ + ${MAPPER_PATH} \ + ${MAPPER_IFACE} \ + GetSubTree sias \ + ${INVENTORY_PATH} 0 1 ${NETWORK_ITEM_IFACE} \ + 2>/dev/null | grep ${INVENTORY_PATH} | grep $1 || true) + else + NETWORK_ITEM_PATH=$(busctl --no-pager --verbose call \ ${MAPPER_IFACE} \ ${MAPPER_PATH} \ ${MAPPER_IFACE} \ GetSubTree sias \ ${INVENTORY_PATH} 0 1 ${NETWORK_ITEM_IFACE} \ 2>/dev/null | grep ${INVENTORY_PATH} || true) + fi # ' STRING "/xyz/openbmc_project/inventory/system/chassis/ethernet";' NETWORK_ITEM_PATH=${NETWORK_ITEM_PATH#*\"} |