Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhel10 fix 43460 2 #21

Merged
merged 5 commits into from
Aug 28, 2024
Merged

rhel10 fix 43460 2 #21

merged 5 commits into from
Aug 28, 2024

Conversation

pvalena
Copy link
Collaborator

@pvalena pvalena commented Aug 28, 2024

  • revert(dracut-init.sh): add module to mods_to_load before checking dependencies
  • fix(squash): remove cyclic dependency
  • fix(dracut.sh): exit when installing the squash loader fails
  • fix(squash-lib): harden against empty $initdir

Cherry-picked commits:
bddbb11bbbfc405317a6fbd53bb189b575d46da2
d5783635950e38cccf334e7163db79f280650fa2
8909d892a7a055ae95be45416e6fbf1b833ff426
6b089c70761c81a7b82a1bfba5f2c1faef7e972f
from PR#616

Resolves: RHEL-43460

prudo1 added 4 commits August 28, 2024 17:30
…pendencies

Commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load before
checking dependencies") introduced a regression. When dracut is in
"auto" mode, i.e. '--modules auto' or no --modules is provided, the
expected behavior is that all modules that return 0 in their check()
function are included. Except for the ones where the dependencies cannot
be installed. The commit however, caused those modules to be included
without their dependencies. Thus revert the commit.

This reverts commit d0f8fde5668cfd7fda1d15824e268b4949b4fd04.

Reported-by: Jo Zzsi <jozzsicsataban@gmail.com>
Signed-off-by: Philipp Rudo <prudo@redhat.com>

(cherry picked from commit bddbb11bbbfc405317a6fbd53bb189b575d46da2)

Resolves: RHEL-43460
With commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load
before checking dependencies") reverted 99squash can no longer rely on
dracut_module_included working as expected in its check() and depends()
function. Solve this problem by breaking up the cyclic dependency
between 99squash and 95squash-{squashfs,erofs} as the commit was
originally introduced to allow this cyclic dependency.

This requires to move all code shared by 95squash-{squashfs,erofs} from
99squash to a new 99squash-lib module and update the dependencies
accordingly. In addition update the checks in dracut.sh to check for
99squash-lib as 99squash is no longer guaranteed to be included.
Finally make sure that 99squash-lib isn't included without a back
end.

While at it improve and align the error messages in 99squash and
99squash-lib.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
(cherry picked from commit d5783635950e38cccf334e7163db79f280650fa2)

Resolves: RHEL-43460
The postinstall phase in 99squash-lib can fail, e.g. when 99squash-lib
is added without one of the required back ends. Usually this isn't fatal
and simply results in a "normal" initrd, i.e. one without squashed
image, being created. Nevertheless, a user needs to explicitly add one
of the required modules for the code to be triggered.  So it is better
to fail with an error rather than giving the user something he didn't
ask for.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
(cherry picked from commit 8909d892a7a055ae95be45416e6fbf1b833ff426)

Resolves: RHEL-43460
The postinstall phase of 99squash-lib has the potential to delete the
whole rootfs if $initdir is empty. This should(tm) never happen.
Nevertheless as the consequences are so devastating it is better to
double check.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
(cherry picked from commit 6b089c70761c81a7b82a1bfba5f2c1faef7e972f)

Resolves: RHEL-43460
@pvalena
Copy link
Collaborator Author

pvalena commented Aug 28, 2024

LGTM.

@pvalena pvalena merged commit fa245ce into main Aug 28, 2024
22 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants