Mac address pinning (interface name) on live system (netboot)
After booting Alpine via network (netboot) to live system, it's not possible to change the interface name to something custom. After installing live-system to disk (setup-disk
) & reboot to installed system, all is working fine.
Steps to reproduce
- Boot Alpine via network (netboot). May https://netboot.xyz/ supports alpine for easy testing without setting up an overloaded ipxe-environment...
- Create
/etc/mactab
with following content:custom0 ff:ff:ff:ff:ff:01 ...
- Create
/etc/network/if-pre-up.d/nameif
with following content:#!/bin/sh /sbin/nameif -s
- In
/etc/network/interfaces
replace e.g.eth0
withcustom0
- Reboot network:
service networking restart
After that you get following error message:
nameif: can't change ifname eth0 to custom0: Resource busy
Issue
Seems the network stack is not unlinked/unmounted/whatever after switching from initramfs to live system (main os). Normally the network stack could be loaded "freshly" after switching, because all needed dependencies are already fetched to ram, so no connection is needed anymore.
PS: I don't know where to search, so if you tell me what needs to be done or may where (I think in initramfs-init.in
-file), I can try to create a MR :-)
PS²: This is also not working by adding files directly to initramfs (instead of replacing mac address via apkovl or directly on live-system). Adding files directly to initramfs does not change anything about naming, they are just ignored.