-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add kdump dracut config #31
Conversation
Hi Lichen, thanks for the patch, overall looks good to me. Since bootc will workaround the issue by itself. Maybe you can send a dracut patch about --extra-confdir? If dracut can merge it soon, we can go with a right solution once and for all instead of using --confdir temporarily |
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. After that, kdump will use --extra-confdir /usr/lib/kdump/dracut.conf.d to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. After that, kdump will use --extra-confdir /usr/lib/kdump/dracut.conf.d to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. After that, kdump will use --extra-confdir /usr/lib/kdump/dracut.conf.d to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. After that, kdump will use --extra-confdir /usr/lib/kdump/dracut.conf.d to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
@daveyoung I created a PR for dracut. |
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. If the dir not exists, will look for confdir's subdir. After that, kdump can use "--add-confdir kdump" if /usr/lib/dracut/dracut.conf.d/kdump exists, to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. If the dir not exists, will look for confdir's subdir. After that, kdump can use "--add-confdir kdump" if /usr/lib/dracut/dracut.conf.d/kdump exists, to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. If the dir not exists, will look for confdir's subdir. After that, kdump can use "--add-confdir kdump" if /usr/lib/dracut/dracut.conf.d/kdump exists, to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
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.
Hi Lichen, dracut merged the pr already, can you update this one?
@daveyoung I think we need to update this patch after dracut-104 is released, otherwise it won't work because the current version of dracut doesn't recognize the --add-confdir option. |
@licliu good point, I thought that this is upstream instead of Fedora we can just assume using upstream latest dracut. But rethinking about it, dependencies need to be added in kdump-utils. For example, if dracut --help|grep "add-confdir" tell us it is supported then we can use the extra confdir, otherwise still use the old way. Otherwise it could be Fedora only in spec file to depend on dracut 104 and later. Thoughts? BTW, maybe you can check with dracut team about the dracut 104 schedule plan. |
Dynamic detection sounds good to me. |
a31b9f0
to
ebf5507
Compare
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.
Hi Lichen,
" If --add-confdir is not
available in your system, kdump will use --confdir, in this case,
the default confdir "/etc/dracut.conf.d" will not work while
generating kdump initrd.", No, I think that we do not need to use --confdir here. The thing can be done like this:
if dracut support --add-confdir, then
use --add-confdir ;
modify mkdumprd:
dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics '' --aggressive-strip -o "plymouth resume ifcfg earlykdump")
move the args hardcode above to the 99-kdump.conf.
else
still keep the args in the mkdumprd code like before.
@daveyoung Thanks, I will try that in the next version. |
This version I pushed was just a rebase with conflicts resolved, and is not ready for review yet. |
Hi @daveyoung, I pushed my latest changes just now. I found that dracutmodules variable cannot be override by dracut command line options, so I still use --confdir here. |
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.
Hi Lichen, it seems this new version still does not cover the previous suggestions. Also the patch description is not aligned with the code, eg. the omit module list is not empy according to the code. Anyway there might be some misunderstandings. I will try to ping you offline to explain about my suggestions. Thanks for reworking on this!
aac3c12
to
a0cdd80
Compare
FTR |
Thanks! Good to know that. |
In some cases, customizing the first kernel's initrd is necessary by modifying the dracut `omit_dracutmodules` options, such as in Bootc or CoreOS scenarios [1]. However, these changes can unintentionally break existing functionality in kdump. For instance, setting `omit_dracutmodules='nfs'` prevents the `nfs` module from being added. Additionally, some dracut configurations [2] use `dracutmodules+='some modules'` instead of `add_dracutmodules+='some modules'`. When `dracutmodules` is non-empty, dracut includes only the specified modules, which can result in an initrd that lacks necessary modules, causing kdump to fail. Dracut upstream support --add-confdir now, kdump can use this option when building kdump initramfs. This patch moved the hardcoded dracutmodules from mkdumprd to the new conf file /lib/kdump/dracut.conf.d/99-kdump.conf, it is easier to check and modify to omit or add certain modules. This patch also initialize dracutmodules to empty to avoid the influence of other configurations. See also: [1] rhkdump#11 [2] https://issues.redhat.com/browse/RHEL-49590?focusedId=25197134&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-25197134 Suggested-by: Dave Young <[email protected]> Suggested-by: Colin Walters <[email protected]> Signed-off-by: Lichen Liu <[email protected]>
a0cdd80
to
73f04a3
Compare
Hi Pavel, thanks for the info! This should be used as a workaround, eg. users can use this in kdump.conf dracut_args to force nfs working. But it is not good to use this in kdump scripts, because there might be other cases not only for nfs, also may need overwrite other things eg. omit modules etc. So I think we should still wait for the --add-confdir in dracut. Anyway it is fine that we suggest people to workaround the issue before dracut backport is ready. |
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. If the dir not exists, will look for confdir's subdir. After that, kdump can use "--add-confdir kdump" if /usr/lib/dracut/dracut.conf.d/kdump exists, to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]> (cherry picked from commit ae81535037c42b716d8cbb9dc18942b5c6f16fed) Resolves: RHEL-66582
When generating kdump's initrd, we want to keep [omit_]dracutmodules empty and let kdump to handle the modules. And we don't want to affect the first kernel's initrd, so we cannot place our conf file to /etc/dracut.conf.d or /usr/lib/dracut/dracut.conf.d. This patch adds a new option to allow user to add an extra configuration directory to use *.conf files from. If the dir not exists, will look for confdir's subdir. After that, kdump can use "--add-confdir kdump" if /usr/lib/dracut/dracut.conf.d/kdump exists, to apply its own dracut conf. See also: rhkdump/kdump-utils#11 rhkdump/kdump-utils#31 Suggested-by: Dave Young <[email protected]> Signed-off-by: Lichen Liu <[email protected]> (cherry picked from commit ae81535037c42b716d8cbb9dc18942b5c6f16fed) Resolves: RHEL-66582
In some cases, we need to change dracut [omit_]dracutmodules to customize the first kernel's initrd to meet the needs, such as bootc and CoreOS.
In most cases kdump does not use these modules, but the change of [omit]_dracutmodules may break existing functionality. For example, if we set omit_dracutmodules='nfs', the nfs module cannot be added even if we use "dracut_args --force-add 'nfs'".
It is better to maintain its own dracut config for kdump. As the first try, we start by keeping [omit_]dracutmodules empty.
As a side effect, the default confdir "/etc/dracut.conf.d" will not work while generating kdump initrd.
And dracut can only use --confdir once, so "dracut_args --confidr" in /etc/kdump.conf will no longer work. This may be avoided in the future by adding something like "--extra-confdir" to dracut.