Hi.
I'm starting this new topic as I found out this one https://archlinuxarm.org/forum/viewtopic.php?f=47&t=11946#p56553 without a definite answer.
I run into the same, problem, namely my odroid u2 would generate new mac address for ethernet port on every reboot. There was also an error in the journalctl log:
$this->bbcode_second_pass_code('', 'Jan 05 11:33:16 alarm systemd-udevd[235]: Could not generate persistent MAC address for eth0: No such file or directory')
After some searching I found out that the boot. script has macaddress assignment commented out, so the system was trying to generate random one on every boot.
The script in /boot/boot.txt starts with
$this->bbcode_second_pass_code('', '# After modifying, run ./mkscr
# MAC address configuration
#setenv macaddr "00:1e:ee:61:7a:39"
...')
First you need to remove the comment before setenv command. You probably shouldn't leave the default macaddress, so I generated a random one. Note MAC addresses have some limitations (two bits in first byte are important and cannot be random) as described here https://superuser.com/a/725472 and the proper one-liner was found here https://serverfault.com/a/631119
$this->bbcode_second_pass_code('', 'printf '%02x' $((0x$(od /dev/urandom -N1 -t x1 -An | cut -c 2-) & 0xFE | 0x02)); od /dev/urandom -N5 -t x1 -An | sed 's/ /:/g'')
resulting with a proper random MAC address - mine was:
$this->bbcode_second_pass_code('', 'c2:f6:f1:5a:99:27')
So, I copied this random MAC and pasted it into the /boot/boot.txt script into the quotes of setenv macaddr command. Now it read:
$this->bbcode_second_pass_code('', '# After modifying, run ./mkscr
# MAC address configuration
setenv macaddr "c2:f6:f1:5a:99:27"
...')
Next, it's important to generate proper uboot script (boot.scr) out of the source boot.txt:
$this->bbcode_second_pass_code('', '[root@alarm boot]# ./mkscr
Image Name: U-Boot boot script
Created: Sat Jan 5 13:10:40 2019
Image Type: ARM Linux Script (uncompressed)
Data Size: 668 Bytes = 0.65 KiB = 0.00 MiB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 660 Bytes = 0.64 KiB = 0.00 MiB
')
(Note, you need to have uboot-tools installed, so, if running the above commands in archlinux, install them with
$this->bbcode_second_pass_code('', 'pacman -S uboot-tools'))
Next, reboot the odroid.
You can check if your mac address is now persistent over reboots
$this->bbcode_second_pass_code('', 'ifconfig eth0 |grep ether')
Hope this helps,
Y