stage2,initrd-*: fix adding udev rules for named network interfaces

If udev-rule-generator-net is installed on the system, add the interface
naming rules from this package to the initrd. If not, add the standard
udev rules.
This commit is contained in:
Anton Midyukov 2023-03-10 19:31:26 +07:00
parent ad6c7671ac
commit 45371fb58e
3 changed files with 13 additions and 4 deletions

View File

@ -25,8 +25,6 @@ FEATURES += bootchain-waitdev
FEATURES += bootchain-getimage
FEATURES += bootchain-nfs
FEATURES += bootchain-cifs
PUT_UDEV_RULES += *-net-setup-link.rules *-net-description.rules
PUT_FILES += /lib/systemd/network/99-default.link
EOF
for module in $(grep -v ^# /.in/modules | sort -u | tr -s '\n' ' '); do

View File

@ -20,8 +20,6 @@ done
cat >> /etc/initrd.mk <<EOF
FEATURES += add-modules compress cleanup
PUT_UDEV_RULES += *-net-setup-link.rules *-net-description.rules
PUT_FILES += /lib/systemd/network/99-default.link
EOF
for module in $(grep -v ^# /.in/modules | sort -u | tr -s '\n' ' '); do

View File

@ -0,0 +1,13 @@
#!/bin/sh -efu
if rpm -q udev-rule-generator-net; then
cat >> /etc/initrd.mk <<-EOF
PUT_UDEV_RULES += 75-persistent-net-generator.rules
PUT_FILES += /lib/udev/write_net_rules
EOF
else
cat >> /etc/initrd.mk <<-EOF
PUT_UDEV_RULES += *-net-setup-link.rules *-net-description.rules
PUT_FILES += /lib/systemd/network/99-default.link
EOF
fi