dracut
dracut copied to clipboard
Including a networkd configuration file breaks file permissions and thus systemd-networkd
Describe the bug
I'm using the systemd-networkd module together --install /etc/systemd/network/20-wired.network to configure networking in the initramfs. The original file has the following permissions as recommended by systemd:
rw-r----- 1 root systemd-network 424 20-wired.network
But the initramfs includes the file with the owner & group set to root root, which prevents the file from being read by systemd-networkd in the initramfs.
Distribution used gentoo. The problem is technically distribution agnostic.
Dracut version dracut-056
Init system systemd
To Reproduce See introduction. Reproduction is trivial by including a file with the given permissions.
Expected behavior The included file should have the same owner and group as the original file, but translated to the correct owner ids within the initramfs, as the mode is also preserved. I think it also might be viable to allow specifying a new mode and/or owner explicitly on the command-line.
This issue has already been fixed in dracut-057 by #1771
Closing based on @aafeijoo-suse 's last comment