OK, the change can be made persistent by creating a .conf file in
/etc/dracut.conf.d with contents `add_dracutmodules+=" systemd-networkd
"` (the spaces are important).

In my case, I also had to create a custom network config for systemd-networkd, 
since the default config caused DDNS entries to be created on boot which then 
couldn't be overwritten with the "real" IP addresses in the running system. To 
create a custom config:
* Add a directory under /usr/lib/dracut/modules.d
* In the directory, create the systemd-networkd config in a .network file
* In the directory, create a file module-setup.sh with contents like:
#!/bin/bash

check() {
  return 0
}

depends() {
  echo systemd-networkd
  return 0
}

install() {
  inst_simple "$moddir"/myconfig.network /etc/systemd/network/myconfig.network
}


You can check if the files are included by running `lsinitrd /boot/initrd.img | 
grep network` after regenerating the initramfs.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2125746

Title:
  Network in initramfs not working with Dracut

To manage notifications about this bug go to:
https://bugs.launchpad.net/dracut/+bug/2125746/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to