[Bug 1868892] Re: initramfs-tools/hooks/udev for network *.link really sucks
Dan Streetman
ddstreet at canonical.com
Wed May 13 20:11:22 UTC 2020
focal:
ubuntu at lp1868892-f:~$ dpkg -l systemd|grep systemd
ii systemd 245.4-4ubuntu3 amd64 system and service manager
ubuntu at lp1868892-f:~$ sudo touch /etc/systemd/network/lp1868892.link
ubuntu at lp1868892-f:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-29-generic
ubuntu at lp1868892-f:~$ sudo lsinitramfs /boot/initrd.img-5.4.0-29-generic | grep lp1868892
usr/lib/systemd/network/lp1868892.link
ubuntu at lp1868892-f:~$ sudo mv /etc/systemd/network /etc/systemd/network.abc
ubuntu at lp1868892-f:~$ sudo ln -s network.abc /etc/systemd/network
ubuntu at lp1868892-f:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-29-generic
ubuntu at lp1868892-f:~$ sudo lsinitramfs /boot/initrd.img-5.4.0-29-generic | grep lp1868892
ubuntu at lp1868892-f:~$
ubuntu at lp1868892-f:~$ sudo rm /etc/systemd/network
ubuntu at lp1868892-f:~$ sudo mv /etc/systemd/network.abc /etc/systemd/network
ubuntu at lp1868892-f:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-31-generic
ubuntu at lp1868892-f:~$ sudo lsinitramfs /boot/initrd.img-5.4.0-31-generic | grep lp1868892
usr/lib/systemd/network/lp1868892.link
ubuntu at lp1868892-f:~$ dpkg -l systemd|grep systemd
ii systemd 245.4-4ubuntu3.1 amd64 system and service manager
ubuntu at lp1868892-f:~$ sudo touch /etc/systemd/network/lp1868892.link
ubuntu at lp1868892-f:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-31-generic
ubuntu at lp1868892-f:~$ sudo lsinitramfs /boot/initrd.img-5.4.0-31-generic | grep lp1868892
usr/lib/systemd/network/lp1868892.link
ubuntu at lp1868892-f:~$ sudo mv /etc/systemd/network /etc/systemd/network.abc
ubuntu at lp1868892-f:~$ sudo ln -s network.abc /etc/systemd/network
ubuntu at lp1868892-f:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-31-generic
ubuntu at lp1868892-f:~$ sudo lsinitramfs /boot/initrd.img-5.4.0-31-generic | grep lp1868892
usr/lib/systemd/network/lp1868892.link
** Tags removed: verification-needed verification-needed-focal
** Tags added: verification-done verification-done-focal
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1868892
Title:
initramfs-tools/hooks/udev for network *.link really sucks
Status in systemd package in Ubuntu:
Fix Released
Status in systemd source package in Xenial:
Fix Released
Status in systemd source package in Bionic:
Fix Released
Status in systemd source package in Eoan:
Fix Released
Status in systemd source package in Focal:
Fix Committed
Bug description:
[impact]
If the /{etc,lib}/systemd/network directory itself is a symlink, the find
command will not actually find any of the files in the dir it links to.
[test case]
$ sudo touch /etc/systemd/network/lp1868892.link
$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-21-generic
...
$ sudo lsinitramfs /boot/initrd.img-5.4.0-21-generic | grep lp1868892
usr/lib/systemd/network/lp1868892.link
$ sudo mv /etc/systemd/network /etc/systemd/network.abc
$ sudo ln -s network.abc /etc/systemd/network
$ sudo update-initramfs -u
$ sudo lsinitramfs /boot/initrd.img-5.4.0-21-generic | grep lp1868892
$
[regression potential]
this adjusts how link files are included in the initramfs, so
regressions would likely occur when creating new initramfs, such as
failure to create initramfs at all, or failure to properly copy link
files into the initramfs, causing network setup failure.
[scope]
this is a Debian/Ubuntu specific file, and the Debian MR was just
opened, so this is needed for Debian and all releases of Ubuntu.
[other info]
This bug likely has a very limited impact, as it is uncommon to
symlink either the /lib/systemd/network or /etc/systemd/network dirs.
[original description]
If one creates e.g. /etc/systemd/network.cu and
/etc/systemd/network.fc and symlinks /etc/systemd/network to one of
them, network setup will fail on reboot, because /usr/share/initramfs-
tools/hooks/udev does a very poor job: it simply checks for a
directory instead of the link files and therefore skips copying
required files to the ram image. Another poor job is done when copying
the files to the ram image: instead of following symlinks it copies
them as which in turn makes them useless, because it does not copy the
related dirs and thus the symlinks point to nothing. So keeping the
system in an consistent state which such poor scripts is very hard,
asking for trouble.
Suggested fix is attached.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1868892/+subscriptions
More information about the foundations-bugs
mailing list