sunxi: ensure NanoPi R1 has unique MAC address
authorJan-Niklas Burfeind <git@aiyionpri.me>
Fri, 23 Dec 2022 21:03:14 +0000 (22:03 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sun, 25 Dec 2022 01:27:55 +0000 (02:27 +0100)
commitc7d3bbb909bdcccd4f26f18b18cc1cb00500a874
treeaf9de04cf6c5b065d15ce34f0983b8f4666b7a7b
parent59254010077c9086afee8a8b4c490943d6749065
sunxi: ensure NanoPi R1 has unique MAC address

Ensure the MAC address for all NanoPi R1 boards is assigned uniquely for
each board.

The vendor ships the device in two variants; one with and one without
eMMC; but both without static mac-addresses.
In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S and R4S in case the EEPROM
chip is not present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R1#Hardware_Spec

Similar too and based on:

commit b5675f500daf ("rockchip: ensure NanoPi R4S has unique MAC address")

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
package/base-files/files/lib/functions/system.sh
target/linux/rockchip/armv8/base-files/etc/board.d/02_network
target/linux/sunxi/base-files/etc/board.d/02_network