Skip to content

initramfs: allow setting the MAC address from a file in the sd card - #35

Merged
EmilioPeJu merged 1 commit into
mainfrom
mac-from-sdcard
Jul 3, 2026
Merged

initramfs: allow setting the MAC address from a file in the sd card#35
EmilioPeJu merged 1 commit into
mainfrom
mac-from-sdcard

Conversation

@EmilioPeJu

Copy link
Copy Markdown
Contributor

No description provided.

@EmilioPeJu

Copy link
Copy Markdown
Contributor Author

I think I like the idea of deleting the MAC configuration logic from the initramfs script, the ideal place for doing that in my opinion would be in the panda config service (which configures the network) and it would base the configuration on target-defs (as Tom suggested), however, there is a limitation there, a systemd service can never prompt the user for input.... so here is the question: Could we get rid of this feature of asking for the MAC and just support the MAC file in the SD card for that purpose?
My proposal is doing it in the get_mac_address function in target-defs, something like:

get_mac_address()
{
    [ -f /boot/MAC ] && cp /boot/MAC /qspi/MAC && mv /boot/MAC /boot/MAC.done
    cat /qspi/MAC
}

no need to validate MAC, the ifconfig command will do it. This also has the extra feature that it will not fail the boot if the MAC address is not set, I think that is better because at least you can fix the problem using ssh

@EmilioPeJu

Copy link
Copy Markdown
Contributor Author

It was decided to keep the same read MAC logic in initramfs init script

@EmilioPeJu
EmilioPeJu merged commit 7c1f39e into main Jul 3, 2026
3 checks passed
@EmilioPeJu
EmilioPeJu deleted the mac-from-sdcard branch July 3, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant