The block device rules were split out from 60-persistent-storage.rules
into its own rules file in v220. Those rules ensure that change events
are emitted and the udev db is updated after metadata changes.
Closes: #958397
Thanks: Pascal Hambourg
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.
Use the find -L param to follow symlinks.
Note that the -L does not need to be provided to the cp command, as when
using only the -p parameter symlinks are followed by default. Also,
the [ -d ] test follows symlinks by default, and does not need changing.
LP: #1868892
initramfs-tools will use shellcheck on its own code and will probably
ship a shellcheck autopkgtest that checks its hooks and script
directory. That's how the shellcheck issues in systemd's initramfs-tools
scripts were found.
```
shellcheck -e SC1091 $(find debian/extra/initramfs-tools/ -type f)
```
debian/extra/initramfs-tools/hooks/udev: Copy all /etc/udev/rules.d/*.rules
rules which are not merely overriding the one in /lib/, not just
70-persistent-net.rules. They might contain network names or other bits which
are relevant for the initramfs.
Closes: #795494
Currently, only the default .link files from /lib/systemd/network are
copied to the initramfs, meaning, that additional (local) .link naming
definitions will be ignored when the system is still controlled by the
initramfs and interfaces might get wrong names.
Fix this by copying all .link files from /lib/systemd/network and
/etc/systemd/network into the initramfs, with the files from
/etc/systemd/network taking precedence over files with the same name
from /lib/systemd/network, as stated in the systemd.link manpage.
Closes: #793374
The previous commit added the new net.ifnames machinery to initramfs, to get
consistent names in initramfs and the real system. However, we also need to
copy the legacy 70-persistent-net.rules to avoid getting different names in
both places. Thanks Adam Conrad!
Stop installing 55-dm.rules, 64-md-raid.rules,
60-persistent-storage-lvm.rules and 60-persistent-storage-dm.rules.
The mdadm, lvm2 and dmsetup package provide their own udev hooks
nowadays to make sure their udev rules files are installed into the
initramfs. Having the copy rules at two places is confusing and makes
debugging harder.