summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-network
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@linux.intel.com>2021-01-27 22:47:14 +0300
committerJason M. Bills <jason.m.bills@linux.intel.com>2021-01-28 02:23:52 +0300
commit7c5f8839ec3d71a2170b8f3514a16a67c69d1c7c (patch)
tree729dbf87ba33bf4d83b5d95496ce18f99a61ef03 /meta-openbmc-mods/meta-common/recipes-network
parent98cc5cd6483975b64d80e8323f7f659dd1337d75 (diff)
downloadopenbmc-7c5f8839ec3d71a2170b8f3514a16a67c69d1c7c.tar.xz
Update to internal 0.29
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-network')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check b/meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check
index 7e81ad63a..2578785b4 100644
--- a/meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check
+++ b/meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check
@@ -18,7 +18,7 @@ SOFS_MACDIR=${SOFS_MNT}/factory-settings/network/mac
read_hw_mac() {
local iface="$1"
- cat /sys/class/net/"$iface"/address 2>/dev/null
+ cat /sys/class/net/"$iface"/address 2>/dev/null | tr [:upper:] [:lower:] 2>/dev/null
}
set_hw_mac() {
@@ -33,12 +33,12 @@ set_hw_mac() {
read_sofs_mac() {
local iface="$1"
- cat "${SOFS_MACDIR}/${iface}" 2>/dev/null
+ cat "${SOFS_MACDIR}/${iface}" 2>/dev/null | tr [:upper:] [:lower:] 2>/dev/null
}
read_fw_env_mac() {
local envname="$1"
- fw_printenv "$envname" 2>/dev/null | sed "s/^$envname=//"
+ fw_printenv "$envname" 2>/dev/null | sed "s/^$envname=//" 2>/dev/null | tr [:upper:] [:lower:] 2>/dev/null
}
set_fw_env_mac() {
@@ -97,10 +97,16 @@ error=0
first_error_seen=0
while read IFACE UBDEV; do
- mac_check "$IFACE" "$UBDEV"
- error=$?
- if [ $error -ne 0 ] && [ $first_error_seen -eq 0 ]; then
- first_error_seen=$error
+ # Try to configure the MAC address if the kernel finds the NIC. Blindly
+ # trying all of the interfaces listed in the DOCSTRING (END_CONF) below
+ # may result in first_error_seen being set to a non-zero value. If that
+ # happens the journal log will report the error, which is undesirable.
+ if [ -h /sys/class/net/$IFACE ]; then
+ mac_check "$IFACE" "$UBDEV"
+ error=$?
+ if [ $error -ne 0 ] && [ $first_error_seen -eq 0 ]; then
+ first_error_seen=$error
+ fi
fi
done <<-END_CONF
eth0 eth1addr