Bug#984650: update-initramfs fails when /etc/systemd/network/99-default.link is symlink to /dev/null

Michael Biebl biebl at debian.org
Tue Mar 16 18:42:48 GMT 2021

Control: tags -1 + help

On Sat, 6 Mar 2021 17:22:17 +0100 Frederik Lindenaar
<frederik at lindenaar.nl> wrote:
> Hi Cyril,
> Thank you for the quick reply
> As Ben also pointed out, I probably have indeed mixed up /dev/zero
and /dev/null and had already fixed that by using an empty file.
Nevertheless the result was pretty odd (the disk filling up rapidly)
and very confusing so might still be useful to prevent this (if
> Why not use a cp -aLt <directory> {} instead to prevent this?

This wouldn't produce the right result afaics. If you mask a file by
symlinking it to /dev/null, the current code produces a file with zero-
size (which is also acceptable for masking files).

If you dereference (-L), you instead copy a character device, which is
not the same as a zero-sized file.

We also have to keep in mind, that if a .link file in
/etc/system/network, pointing to some link elsewhere, we probably do
want to resolve that and not copy a dangling symlink.

The current code is already ugly as it is. I'm not sure, adding more
corner cases is a good idea. That said, I'm open to suggestions. The
code must

- make sure files with the same name in /etc/systemd/network take
precedence of files in /lib/systemd/network
- correctly handle masked .link files (i.e. files pointing at
- correctly handle the case that /etc/systemd/network doesn't exist or
itself is a symlink

I'm happy to take a patch for that.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20210316/a7fe2225/attachment.sig>

More information about the Pkg-systemd-maintainers mailing list