[PATCH] sunxi: ensure NanoPi R1 has unique MAC address
David Bauer
mail at david-bauer.net
Thu Dec 22 18:42:02 PST 2022
Hi Jan-Niklas,
On 12/22/22 21:12, Jan-Niklas Burfeind wrote:
> +generate_mac_from_mmc_cid()
> +{
> + local mmc_dev=$1
> +
> + local sd_hash=$(sha256sum/sys/class/block/$mmc_dev/device/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}")")"
> +}
> +
rename this function to macaddr_generate_from_mmc_cid and add it to the base-files package.
Also change the other consumer from using its implementation to the shared one.
Best
David
More information about the openwrt-devel
mailing list