summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2024-09-03 16:42:37 +0200
committerSimon Rettberg2024-09-03 16:42:37 +0200
commit522afc19eafb49b41eb3beded56f4d974f6b86ca (patch)
treed5f537164490411af66ae38b040f6a94a374c619 /core
parent[iptables-helper] Reduce SPAM (diff)
downloadmltk-522afc19eafb49b41eb3beded56f4d974f6b86ca.tar.gz
mltk-522afc19eafb49b41eb3beded56f4d974f6b86ca.tar.xz
mltk-522afc19eafb49b41eb3beded56f4d974f6b86ca.zip
[dhcpc-busybox] Wait for udev to rename eth* devices
Diffstat (limited to 'core')
-rwxr-xr-xcore/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-bridge_additional_nics17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-bridge_additional_nics b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-bridge_additional_nics
index f508257f..605e2e9d 100755
--- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-bridge_additional_nics
+++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-bridge_additional_nics
@@ -23,6 +23,23 @@ is_slave() {
return 1
}
+# OK so if you feel motivated to do this properly: We need a way
+# to wait until systemd-udevd did the renaming stuff, or we might
+# end up either taking a device up as e.g. eth0 and prevent systemd
+# from renaming it, or end up missing a device as it will get renamed
+# just after the glob expanded.
+for nic in /sys/class/net/*; do
+ ifname="${nic##*/}"
+ # do not handle the primary interface
+ if [ "$SLX_PXE_NETIF" = "${ifname}" ]; then
+ continue
+ fi
+ if [[ $ifname = eth* ]]; then
+ echo "Possible pre-rename, found '$ifname', sleeping"
+ sleep 2
+ fi
+done
+
declare -g id=1
for nic in /sys/class/net/*; do
ifname="${nic##*/}"