From 4f9a7bcdbb8568d17365437c8eee8bcc2e4176ff Mon Sep 17 00:00:00 2001 From: chewitt Date: Wed, 11 Nov 2020 01:44:18 +0000 Subject: [PATCH] amlogic: ethmactool support alternate secure-monitor node --- packages/sysutils/ethmactool/scripts/ethmactool-config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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