mkdumprd: add --aggressive-strip as default dracut args

The new aggressive strip option was added in dracut 058, which tell
dracut to build the initramfs stripping more sections of the ELF
binaries (basically strip .symtab, .strtab).

These section are only useful for debugging runtime failures, but in
kdump kernel, neccessary tools for debug any runtime failure are
absent, there is no point keeping these sections.

Stripping these section can help save some memory with almost no side
effect. So let enable --aggressive-strip by default.

Comparison of unpacked initramfs before / after enabling aggressive strip:

du -hs image image.aggressive-strip
31M     image
29M     image.aggressive-strip

Signed-off-by: Kairui Song <kasong@tencent.com>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Reviewed-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Kairui Song 2023-04-28 00:04:45 +08:00 committed by Coiby Xu
parent ea7be0608e
commit c8643af270
2 changed files with 4 additions and 4 deletions

View File

@ -61,9 +61,9 @@ Requires(post): servicelog
Recommends: keyutils
%endif
Requires(pre): coreutils sed zlib
Requires: dracut >= 050
Requires: dracut-network >= 050
Requires: dracut-squash >= 050
Requires: dracut >= 058
Requires: dracut-network >= 058
Requires: dracut-squash >= 058
Requires: ethtool
Requires: util-linux
Requires: binutils

View File

@ -27,7 +27,7 @@ SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
extra_modules=""
dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics '' -o "plymouth resume ifcfg earlykdump")
dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics '' --aggressive-strip -o "plymouth resume ifcfg earlykdump")
MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."