From cceddc41fd2511db52456835f24ea7e6381fab58 Mon Sep 17 00:00:00 2001 From: Nick Rosbrook Date: Tue, 24 Feb 2026 14:05:05 -0500 Subject: [PATCH] network-generator: support BOOTIF= and rd.bootif=0 options The network generator currently supports many of the options described by dracut.cmdline(7), but not everything. This commit adds support for the BOOTIF= option (and the related rd.bootif= option) used in PXE setups. This is implemented by treating BOOTIF as a special name/placeholder when used as an interface name, and expecting a MAC address to be set in the BOOTIF= parameter. The resulting .network file then uses MACAddress= in the [Match] section, instead of Name=. --- man/systemd-network-generator.service.xml | 19 +++- .../generator/network-generator-main.c | 2 + src/network/generator/network-generator.c | 97 ++++++++++++++++++- src/network/generator/network-generator.h | 6 ++ .../generator/test-network-generator.c | 83 ++++++++++++++++ 5 files changed, 204 insertions(+), 3 deletions(-) diff --git a/man/systemd-network-generator.service.xml b/man/systemd-network-generator.service.xml index ccdb57b62b..7b20f8516d 100644 --- a/man/systemd-network-generator.service.xml +++ b/man/systemd-network-generator.service.xml @@ -100,10 +100,27 @@ + + BOOTIF= + rd.bootif= + + When BOOTIF is specified in the interface field of ip=, it is treated + as a special placeholder rather than a real interface name. Then, in combination with the MAC address provided + by BOOTIF=, this is translated into a + systemd.network5 file + which matches on the the provided MAC address. When rd.bootif=0 is passed, this functionality + is disabled, and the BOOTIF= option is ignored. + + See dracut.cmdline7 + for details on the usage of these options. + + + + +