mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
rockchip: fix NanoPi R4SE has unique MAC address when boot from emmc
This commit is contained in:
parent
62ef304e67
commit
0e7c277d03
@ -39,9 +39,7 @@ rockchip_setup_interfaces()
|
||||
|
||||
generate_mac_from_mmc_cid()
|
||||
{
|
||||
local mmc_dev=$1
|
||||
|
||||
local sd_hash=$(sha256sum /sys/class/block/$mmc_dev/device/cid)
|
||||
local sd_hash=$(sha256sum /sys/class/block/mmcblk*/device/cid | head -n 1)
|
||||
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}")")"
|
||||
}
|
||||
@ -58,7 +56,7 @@ nanopi_r4s_get_mac()
|
||||
address=$(macaddr_setbit_la "$address")
|
||||
fi
|
||||
else
|
||||
address=$(generate_mac_from_mmc_cid mmcblk1)
|
||||
address=$(generate_mac_from_mmc_cid)
|
||||
if [ "$interface" = "lan" ]; then
|
||||
address=$(macaddr_add "$address" 1)
|
||||
fi
|
||||
@ -84,7 +82,7 @@ rockchip_setup_macs()
|
||||
friendlyarm,nanopi-r2s|\
|
||||
friendlyarm,nanopi-r5s|\
|
||||
sharevdi,guangmiao-g4c)
|
||||
wan_mac=$(generate_mac_from_mmc_cid mmcblk0)
|
||||
wan_mac=$(generate_mac_from_mmc_cid)
|
||||
lan_mac=$(macaddr_add "$wan_mac" +1)
|
||||
;;
|
||||
friendlyarm,nanopi-r4s|\
|
||||
|
Loading…
Reference in New Issue
Block a user