]> git.ipfire.org Git - thirdparty/dracut-ng.git/commit
fix(dracut-init.sh): add module to mods_to_load before checking dependencies
authorPhilipp Rudo <prudo@redhat.com>
Thu, 25 Jul 2024 10:47:00 +0000 (12:47 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Wed, 31 Jul 2024 11:41:26 +0000 (07:41 -0400)
commitd0f8fde5668cfd7fda1d15824e268b4949b4fd04
tree85ffb5df1f5fa19817e4523d9584755368ca2a66
parent3ad7e6c23bdcac7c7f6adc8a2cb31bab3c37038a
fix(dracut-init.sh): add module to mods_to_load before checking dependencies

When implementing erofs support for 99squash we end up with three
modules 99squash, 95squash-squashfs and 95squash-erofs. Where 99squash
contains the common code for filesystem images and
95squash-{squashfs,erofs} the special handing depending on the
filesystem used. This leads to a dependency cycle as we want to allow
users both to choose 99squash, when the exact filesystem doesn't matter,
as well as 95squash-{squashfs,erofs} when a specific filesystem is
required.

But when 99squash is added as a dependency calling
dracut_module_included fails in its depends() function. This lead to
cases where both handlers, 95squash-squashfs and 95squash-erofs, were
added to the initrd.

Reason for the failure is that a module only is marked to be loaded
after all it's dependencies have been checked as well. Thus a child
module cannot detect which parent module wants it to be included. Fix
this by marking modules to be loaded before checking its dependencies in
check_module. Do the same change in check_mount for consistency.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
dracut-init.sh