operating-system
operating-system copied to clipboard
ODROID-M1: Different MAC address in system compared to petitboot/onboard label
Describe the issue you are experiencing
While doing extensive tests with an ODROID-M1 installation I recognized that the mac address a ODROID-M1 system receives during HomeAssistantOS bootup/use is somewhat different to what is printed on the PCB label of the system as well as the system receives via the petitboot manager (which is entered without any media/SD card attached).
After some investigation it seems that MAC related issues is somewhat known with the ODROID-M1 and ppl even get changing MAC addresses throughout reboots on different platforms, see:
https://forum.odroid.com/viewtopic.php?p=349905#p349905 https://forum.odroid.com/viewtopic.php?p=350236#p350236 https://forum.odroid.com/viewtopic.php?p=354135#p354135 https://forum.odroid.com/viewtopic.php?p=247661#p247661
In addition, even in the RaspberryMatic project where ODROID-M1 support is underway (still WIP) we get changing MAC addresses on each reboot because we simply don't use systemd / network-manager which potentially workaround this issue by choosing a MAC address in a different manner when not being able to receive the hardware assigned MAC address (e.g. via efuse device interface).
Even thought this might look like a minor issue because the MAC address seems to be cached or at least stable assigned by network manager in case of HomeAssistantOS, this looks like a principle issue where ppl could run into issues in case they want to do a fresh install or do some testing with a different OS on a different SD card/storage and notice that their system is suddenly available under a totally different IP/MAC address. In addition, with the bug the running system has a different MAC address compared to the printed label on the system itself and also different in petitboot where the MAC address is correct compared to the onboard label on the PCB.
What operating system image do you use?
odroid-m1 (Hardkernel ODROID-M1)
What version of Home Assistant Operating System is installed?
10.3
Did you upgrade the Operating System.
No
Steps to reproduce the issue
- Flash a fresh SD card with latest HomeAssistantOS and boot system
- login to CLI and check mac address with
ip aand compare to onboard label - remove any media/SD card and boot into petitboot manager and exit to shell and then enter
ip ato see that the MAC address reported by petitboot is perfectly in line with the one printed on the PCB label.
Anything in the Supervisor logs that might be useful for us?
n/a
Anything in the Host logs that might be useful for us?
check `ip a` output for mac address changes and compare to petitboot mac address reported.
System information
No response
Additional information
To me this looks like a U-Boot/Kernel issue where the MAC address is not correctly read/forwarded by/to the kernel during bootup and systemd (in case of HomeAssistantOS) is assigning a pseudo/fallback MAC address to rectify the issue. Unfortunately I did not yet find a kernel/U-boot patch myself which solves this issue and provides the linux kernel the correct mac address which is also printed on the PCB label of the ODROID-M1 hardware.
From what I can tell, the MAC address is indeed different than what is shown on the label. However it is passed from U-Boot to Linux, and seems to be static:
HAOS> pri
...
eth1addr=12:a4:91:35:d8:bc
ethaddr=12:a4:91:35:d8:bd
# ip addr
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 12:a4:91:35:d8:bd brd ff:ff:ff:ff:ff:ff
...
From what I can tell this is generated by SoC specific code: https://github.com/u-boot/u-boot/blob/v2023.04/arch/arm/mach-rockchip/misc.c#L51-L58. Since this are generated from the CPU ID, they are really guaranteed to be static, and should be essentially unique.
Not sure where the MAC address printed on the label is stored at. I guess we'd have to read some downstream code to find that out. Depending on the location, I'd actually prefer the CPU ID based MAC address...
There hasn't been any activity on this issue recently. To keep our backlog manageable we have to clean old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant OS version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Not sure where the MAC address printed on the label is stored at. I guess we'd have to read some downstream code to find that out. Depending on the location, I'd actually prefer the CPU ID based MAC address...
On M1 this is stored in the SPI flash, on the M1S its stored in the first block of /dev/mmcblk0boot0: https://github.com/hardkernel/u-boot/blob/0bc1633aab0e6acbb2f3d8fea5ec559f0d176e3c/board/hardkernel/odroid-common/board.c#L158