From 91639999d2c87fa28396f72305ffeb98bd77370f Mon Sep 17 00:00:00 2001 From: Emilio Perez Juarez Date: Thu, 2 Jul 2026 12:32:13 +0100 Subject: [PATCH] initramfs: allow setting the MAC address from a file in the sd card --- recipes-core/initrdscripts/files/pinit | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/recipes-core/initrdscripts/files/pinit b/recipes-core/initrdscripts/files/pinit index 2c135969..c94d6b04 100755 --- a/recipes-core/initrdscripts/files/pinit +++ b/recipes-core/initrdscripts/files/pinit @@ -72,6 +72,17 @@ read_mac_address() set-led BOOTING } +configure_mac_address() +{ + if [ -e /boot/MAC ] && validate_mac_address "$(cat /boot/MAC)"; then + echo "Using MAC address from /boot/MAC" + cp /boot/MAC /rootfs/qspi/MAC + mv /boot/MAC /boot/MAC.done + else + read_mac_address + fi +} + echo PandA init set -x @@ -130,7 +141,7 @@ fi # PandABox requires to manually set the MAC address { grep "PandABox" /proc/device-tree/model &> /dev/null; } && [ ! -e /rootfs/qspi/MAC ] && - read_mac_address + configure_mac_address kill $LED_DAEMON_PID sync