aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/rockchip
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/rockchip')
-rwxr-xr-xtarget/linux/rockchip/armv8/base-files/etc/board.d/02_network9
1 files changed, 8 insertions, 1 deletions
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
index e129fd6a67..48133c81a1 100755
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
@@ -17,6 +17,13 @@ rockchip_setup_interfaces()
esac
}
+nanopi_r2s_generate_mac()
+{
+ local sd_hash=$(sha256sum /sys/devices/platform/ff500000.dwmmc/mmc_host/mmc0/mmc0:*/cid)
+ local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)")
+ echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")"
+}
+
rockchip_setup_macs()
{
local board="$1"
@@ -26,7 +33,7 @@ rockchip_setup_macs()
case "$board" in
friendlyarm,nanopi-r2s)
- wan_mac=$(macaddr_random)
+ wan_mac=$(nanopi_r2s_generate_mac)
lan_mac=$(macaddr_add "$wan_mac" +1)
;;
esac