Skip to content

Commit

Permalink
Add kdump dracut config
Browse files Browse the repository at this point in the history
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.

Suggested-by: Dave Young <[email protected]>
Suggested-by: Colin Walters <[email protected]>
Signed-off-by: Lichen Liu <[email protected]>
  • Loading branch information
licliu committed Aug 6, 2024
1 parent 224d310 commit a31b9f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions 99-kdump.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dracutmodules=''
omit_dracutmodules=''
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ manpages:
install -D -m 644 kdump.conf.5 $(DESTDIR)$(mandir)/man5/kdump.conf.5

install: dracut-modules kdump-conf kdump-sysconfig manpages
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
mkdir -p -m755 $(DESTDIR)$(sysconfdir)/kdump/pre.d
mkdir -p -m755 $(DESTDIR)$(sysconfdir)/kdump/post.d
mkdir -p -m755 $(DESTDIR)$(localstatedir)/crash
Expand All @@ -59,6 +59,7 @@ install: dracut-modules kdump-conf kdump-sysconfig manpages
install -D -m 644 kdump.conf $(DESTDIR)$(sysconfdir)
install -D -m 644 kdump.sysconfig $(DESTDIR)$(sysconfdir)/sysconfig/kdump
install -D -m 755 kdump-lib.sh kdump-lib-initramfs.sh kdump-logger.sh -t $(DESTDIR)$(pkglibdir)
install -D -m 644 99-kdump.conf -t $(DESTDIR)$(pkglibdir)/dracut.conf.d

ifeq ($(ARCH), $(filter ppc64le ppc64,$(ARCH)))
install -m 755 mkfadumprd $(DESTDIR)$(sbindir)
Expand Down
3 changes: 3 additions & 0 deletions mkdumprd
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,7 @@ if ! is_fadump_capable; then
fi
fi

[[ $kdumpdracutconfdir ]] || kdumpdracutconfdir=/lib/kdump/dracut.conf.d
[ -d "$kdumpdracutconfdir" ] && add_dracut_arg "--confdir" "$kdumpdracutconfdir"

dracut "${dracut_args[@]}" "$@"

0 comments on commit a31b9f0

Please sign in to comment.