diff --git a/packages/sysutils/ethmactool/scripts/ethmactool-config b/packages/sysutils/ethmactool/scripts/ethmactool-config index e704f32620..18ce061ea0 100755 --- a/packages/sysutils/ethmactool/scripts/ethmactool-config +++ b/packages/sysutils/ethmactool/scripts/ethmactool-config @@ -26,20 +26,23 @@ from_cmdline() { } aml_from_efuse_gxbb() { - if [ -e /sys/devices/platform/efuse/efuse0/nvmem ] ; then + if [ -e /sys/devices/platform/efuse/efuse0/nvmem ]; then MAC=$(od -x -A n -j 0x34 -N 6 /sys/bus/nvmem/devices/efuse0/nvmem | tr -d ' ') MAC=${MAC:2:2}${MAC:0:2}${MAC:6:2}${MAC:4:2}${MAC:10:2}${MAC:8:2} fi } aml_from_efuse_gxl() { - if [ -e /sys/devices/platform/efuse/efuse0/nvmem ] ; then + if [ -e /sys/devices/platform/efuse/efuse0/nvmem ]; then MAC=$(cat /sys/devices/platform/efuse/efuse0/nvmem) fi } aml_from_cpu_sn() { - if [ -e /sys/bus/platform/devices/firmware\:secure-monitor/serial ] ; then + if [ -e /sys/bus/platform/devices/secure-monitor/serial ]; then + MAC=$(cat /sys/bus/platform/devices/secure-monitor/serial 2>/dev/null | cut -b-12) + fixup_self_mac + elif [ -e /sys/bus/platform/devices/firmware\:secure-monitor/serial ]; then MAC=$(cat /sys/bus/platform/devices/firmware\:secure-monitor/serial 2>/dev/null | cut -b-12) fixup_self_mac fi