-
Notifications
You must be signed in to change notification settings - Fork 401
fix(dracut.sh): abort on instmods -c ...
failure
#2202
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
base: master
Are you sure you want to change the base?
Conversation
Hi @haraldh gentle reminder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, please stop spamming reviewers. Usually people have other things to do in life and do not need a ping every 2 days.
dracut: Executing: /usr/bin/dracut -H -f --add-drivers "xen-blkfront ...
...
dracut-install: Failed to find module 'xen_blkfront'
dracut: FAILED: /usr/lib/dracut/dracut-install -o -D /var/tmp/dracut.r2Cc7L/initramfs --kerneldir /lib/modules/6.1.10-1.ph5-secure/ -m ...
You log does not make sense, the -o
option is never printed before -D
... and with --add-drivers
, dracut-install is not called with -o
. What's your distro/dracut version?
Thanks for your advice but I don't think asking for review and inputs is spam, correct me if I'm wrong and I'm unaware of the development process here. How are we supposed reach out to maintainers otherwise? And I tagged the top 3 contributors and asked for their assistance and if they feel that they are getting spammed, my apologies. And everyone have some something to do in their life, and that includes me as well. |
Currently, instmods exit status is not validated and as a result initrd generation continues even when dracut-install fails. For instance when add-drivers is called with a non existent driver: ``` dracut: Executing: /usr/bin/dracut -L 5 -H -f --add-drivers "xen-scsifront invalid xen-blkfront xen-acpi-processor xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs hv_utils hv_vmbus hv_storvsc hv_netvsc hv_sock hv_balloon cn dm-mod megaraid_sas" /boot/initrd.img-6.0.7-8.ph5 6.0.7-8.ph5 ... dracut: *** Including modules done *** dracut-install: Failed to find module 'invalid' dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.9bhous/initramfs --kerneldir /lib/modules/6.0.7-8.ph5/ -m xen_scsifront invalid xen-blkfront xen-acpi-processor xen-evtchn xen-gntalloc xen-gntdev xen-privcmd xen-pciback xenfs hv_utils hv_vmbus hv_storvsc hv_netvsc hv_sock hv_balloon cn dm-mod megaraid_sas dracut: *** Installing kernel module dependencies *** ... ``` Signed-off-by: Shreenidhi Shedi <[email protected]>
Initially I tested with This is the log from
|
I understand that -c would imply check, but nowhere in dracut is that failure fatal. Not even in the fips module where I would expect this is more important to check. What made you to believe that this condition should be fatal instead of just a warning ? Perhaps some man page or some other documentation ? The English word "check" does not necessary imply fatal condition. My concern here is compatibility with earlier dracut version. Bailing out early when e.g. a module name is miss-typed, could lead to initrd no longer generated (when previously it was) and next boot time failed boot. |
Say this is my
I think case, Yes, what you have told is right too. This might result in an entirely different behavior compared to earlier versions but even with the existing approach there is a chance that dracut generates a faulty initrd which makes system unusable.
|
Or we can use a new configuration parameter which can be set in
And by default we can keep it 0 to maintain current behavior and it's up to users to set it to 1. |
@@ -1954,19 +1954,28 @@ if [[ $no_kernel != yes ]]; then | |||
|
|||
if [[ -n ${add_drivers// /} ]]; then | |||
# shellcheck disable=SC2086 | |||
hostonly='' instmods -c $add_drivers | |||
if ! hostonly='' instmods -c $add_drivers; then | |||
dfatal "instmods failed for add_drivers: $add_drivers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be a warning and we should remove the exit to maintain compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new config parameter will have the same effect right? And users can modify to their needs.
If the logs are suppressed, users will never be aware that something is going wrong.
OTOH, agree with you on maintaining compatibility but it should be more flexible and configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new config parameter will have the same effect right?
No, it is not. As it is, this PR increases complexity of the code and reduces test coverage for the code as you did not added a test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this module has a test case? I can enhance it to cover this case, can you please point me where it's done currently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not suggesting that the way to improve this PR is to add a test case. I simply was kind enough to answer your question.
My opinion is that this should be a warning and the new config parameter should not be part of this PR.
I suggest to give time for other reviewers as well to chime in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your time and patience. Let's wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be a warning and we should remove the exit to maintain compatibility.
instmods()
already prints an error message, so adding another warning would be worthless.
IMHO I would not merge this PR as is, as it will break the current behavior.
Currently, instmods exit status is not validated and as a result initrd generation continues even when dracut-install fails.
For instance when add-drivers is called with a non existent driver:
Signed-off-by: Shreenidhi Shedi [email protected]
This pull request changes...
Changes
Checklist
Fixes #