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

kdump should auto-add required modules if they are missing from host initrd #11

Open
jbtrystram opened this issue Jun 11, 2024 · 7 comments

Comments

@jbtrystram
Copy link

jbtrystram commented Jun 11, 2024

In Fedora CoreOS, we exclude nfs from the initramfs as booting from NFS is not supported : https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7

However, dumping with kdump to a target destination should work obviously. Currently, this requires the users to add
extra_modules nfs to /etc/kdump.conf.

Could the module be added automatically when the target is a NFS destination ?

ref: coreos/fedora-coreos-tracker#1729

@daveyoung
Copy link
Contributor

Hi, Coiby filed an RH internal jira issue to dracut, dracut team suggest to use --force-add to override the config file
dracut --force-add nfs
Can you try see if this works I think we can do it in kdump code. Please refer to https://issues.redhat.com/browse/RHEL-26114

@jbtrystram
Copy link
Author

jbtrystram commented Jul 1, 2024

Hello @daveyoung, sorry for the delayed response

I did the following testing today, i was not able to set-up a NFS server for testing so I can only attest what
modules are loaded according to config options.

on FCOS, with the default config the NFS module is not loaded in kdump initramfs (as expected):

kdump:/# modinfo nfs
modinfo: ERROR: Module nfs not found.

With the following kdump.conf config :

          path /var/crash
          extra-modules nfs

I can see the module loaded:

kdump:/# modinfo nfs
filename:       /lib/modules/6.8.11-300.fc40.x86_64/kernel/fs/nfs/nfs.ko.xz
license:        GPL
author:         Olaf Kirch <okir@monad.swb.de>
alias:          nfs4
alias:          fs-nfs4
alias:          fs-nfs
rhelversion:    9.99
depends:        sunrpc,netfs,lockd
retpoline:      Y
intree:         Y
name:           nfs
vermagic:       6.8.11-300.fc40.x86_64 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         Fedora kernel signing key
sig_key:        12:8F:6B:9F:1E:CC:CB:0D:BA:F0:10:12:70:1C:A6:DD:A1:09:9A:11
sig_hashalgo:   sha256
signature:      CC:3........

However, using dracut-args with --force-add like this does not works:

          path /var/crash
         dracut-args --force-add nfs

During the kdump initramfs build dracut fails :

Starting kdump.service - Crash recovery kernel arming...
kdump: No kdump initial ramdisk found.
kdump: Rebuilding /var/lib/kdump/initramfs-6.8.11-300.fc40.x86_64kdump.img
Executing: /usr/bin/dracut --add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics  --aggressive-strip -o "plymouth resume ifcfg earlykdump" --force-add nfs --mount "/dev/disk/by-uuid/bc826339-762e-4f7b-9514-5a6011cc0318 /sysroot xfs rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota" --squash-compressor zstd --no-hostonly-default-device -f /var/lib/kdump/initramfs-6.8.11-300.fc40.x86_64kdump.img 6.8.11-300.fc40.x86_64
Module 'systemd-networkd' will not be installed, because it's in the list to be omitted!
Module 'systemd-pcrphase' will not be installed, because command '/usr/lib/systemd/systemd-pcrphase' could not be found!
Module 'busybox' will not be installed, because command 'busybox' could not be found!
Module 'dbus-daemon' will not be installed, because it's in the list to be omitted!
Module 'rngd' will not be installed, because command 'rngd' could not be found!
Module 'connman' will not be installed, because command 'connmand' could not be found!
Module 'connman' will not be installed, because command 'connmanctl' could not be found!
Module 'connman' will not be installed, because command 'connmand-wait-online' could not be found!
Module 'connman' will not be installed, because command 'connmand' could not be found!
Module 'connman' will not be installed, because command 'connmanctl' could not be found!
Module 'connman' will not be installed, because command 'connmand-wait-online' could not be found!
Module 'ifcfg' will not be installed, because it's in the list to be omitted!
Module 'plymouth' will not be installed, because it's in the list to be omitted!
62bluetooth: Could not find any command of '/usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd'!
Module 'dmraid' will not be installed, because it's in the list to be omitted!
Module 'lvm' will not be installed, because it's in the list to be omitted!
Module 'pcsc' will not be installed, because command 'pcscd' could not be found!
Module 'fcoe' will not be installed, because it's in the list to be omitted!
Module 'fcoe-uefi' will not be installed, because it's in the list to be omitted!
Module 'nbd' will not be installed, because it's in the list to be omitted!
Module 'nfs' will not be installed, because it's in the list to be omitted!
Module 'resume' will not be installed, because it's in the list to be omitted!
Module 'biosdevname' will not be installed, because it's in the list to be omitted!
Module 'earlykdump' will not be installed, because it's in the list to be omitted!
Module 'memstrack' will not be installed, because it's in the list to be omitted!
dracut[E]: Module 'nfs' cannot be installed.
Module 'nfs' cannot be installed.
kdump: mkdumprd: failed to make kdump initrd
kdump: Starting kdump: [FAILED]
kdump.service: Main process exited, code=exited, status=1/FAILURE
kdump.service: Failed with result 'exit-code'.
Failed to start kdump.service - Crash recovery kernel arming.

So detecting the nfs destination from the config file and adding extra-module accordingly should work to workaround any dracuts omits the distribution sets up. I am not sure why force-add does not work though

jbtrystram added a commit to jbtrystram/openshift-docs that referenced this issue Jul 1, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11
@travier
Copy link
Contributor

travier commented Jul 1, 2024

Issue for --force-arg not working as expected: https://issues.redhat.com/browse/RHEL-26114

@pvalena
Copy link

pvalena commented Jul 1, 2024

Please add --debug to the dracut-args, so I can see what's happening in that case (e.g. what's in your config).

@jbtrystram
Copy link
Author

jbtrystram commented Jul 3, 2024

kdump.service.log

@pvalena See attached log file. It's the output of journalctl -o cat -u kdump.service

With kdump.conf as following :

path /var/crash
core_collector nop
failure_action shell
dracut_args --force-add nfs --debug

/etc/sysconfig/kdump was not changed

jbtrystram added a commit to jbtrystram/openshift-docs that referenced this issue Jul 4, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
@pvalena
Copy link

pvalena commented Jul 16, 2024

Hmm, you're right, looking at the code, it looks like the omit_dracutmodules has precedence. I'll look into possible solutions.

jbtrystram added a commit to jbtrystram/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
jbtrystram added a commit to jbtrystram/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/openshift-docs that referenced this issue Jul 17, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
max-cx pushed a commit to max-cx/openshift-docs that referenced this issue Jul 24, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
cgwalters added a commit to cgwalters/kdump-utils that referenced this issue Jul 30, 2024
The Fedora/RHEL bootc base images have dracut drop-ins which set
`dracutmodules+=`.

However that seems override explicit module inclusion on the
command line, which is a dracut bug:
rhkdump#11

Work around this by making our own copy of the global config,
and omitting config drop-ins which trigger this behavior.

I think longer term, this project should probably own its
own global dracut config, actually. But that's a much
larger set of work.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link

Related #29

cgwalters added a commit to cgwalters/kdump-utils that referenced this issue Aug 2, 2024
The Fedora/RHEL bootc base images have dracut drop-ins which set
`dracutmodules+=`.

However that seems override explicit module inclusion on the
command line, which is a dracut bug:
rhkdump#11

Work around this by making our own copy of the global config,
and omitting config drop-ins which trigger this behavior.

I think longer term, this project should probably own its
own global dracut config, actually. But that's a much
larger set of work.

omit_dracutmodules= is also problematic, so skip that too.

Signed-off-by: Colin Walters <walters@verbum.org>
licliu added a commit to licliu/dracut-ng that referenced this issue Aug 7, 2024
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 <dyoung@redhat.com>
Signed-off-by: Lichen Liu <lichliu@redhat.com>
licliu added a commit to licliu/dracut-ng that referenced this issue Aug 7, 2024
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 <dyoung@redhat.com>
Signed-off-by: Lichen Liu <lichliu@redhat.com>
licliu added a commit to licliu/dracut-ng that referenced this issue Aug 7, 2024
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 <dyoung@redhat.com>
Signed-off-by: Lichen Liu <lichliu@redhat.com>
licliu added a commit to licliu/dracut-ng that referenced this issue Aug 7, 2024
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 <dyoung@redhat.com>
Signed-off-by: Lichen Liu <lichliu@redhat.com>
smunje1 pushed a commit to smunje1/openshift-docs that referenced this issue Aug 12, 2024
On RHCOS, the nfs module is explicitly excluded from the initramfs:
https://github.com/coreos/fedora-coreos-config/blob/de0416b8820cffa2ea3b7dbd9e95a9cc0ad9a42b/overlay.d/05core/usr/lib/dracut/dracut.conf.d/coreos-omits.conf#L7
Thus, setting an NFS target destination in kdump.conf will not work
because the kdump initramfs will not have the NFS module. Add
instruction on how to add the module to enable the functionality.

This may not be necessary if kdump auto-detect the required modules:
See rhkdump/kdump-utils#11

Co-authored-by: Jesse Dohmann <jdohmann@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants