inst_simple "$moddir"/99-wait-online-dracut.conf \
"$systemdsystemunitdir"/systemd-networkd-wait-online.service.d/99-dracut.conf
- inst_simple "$moddir"/99-default.network \
- "$systemdnetwork"/zzzz-dracut-default.network
+ inst_simple "$moddir"/dracut-default.network /usr/lib/dracut/dracut-default.network
inst_hook cmdline 99 "$moddir"/networkd-config.sh
inst_hook initqueue/settled 99 "$moddir"/networkd-run.sh
# Customizations for systemd-network-generator generated networks.
# We need to request certain DHCP options, and there is no way to
# tell the generator to add those.
+generated=0
for f in /run/systemd/network/*.network; do
[ -f "$f" ] || continue
echo "RequestOptions=59 60"
} >> "$f"
- # Remove the default network if at least one was generated
- rm -f "$systemdnetworkconfdir"/zzzz-dracut-default.network
+ # at least one was generated
+ generated=1
done
+# Add the default network if none was generated
+if [ "$generated" -eq "0" ]; then
+ cp -a /usr/lib/dracut/dracut-default.network /run/systemd/network/zzzz-dracut-default.network
+fi
+
# Just in case networkd was already running
systemctl try-reload-or-restart systemd-networkd.service