Set zstd as recommented for kexec-tools
This patch will make zstd as recommended instead of required for
kexec-tools. If zstd command/package is unavaliable, it can failback to invoke
gzip when making kdump initramfs.
Fixes: 0311f6e
("Set zstd as the default compression method for kdump initrd")
Signed-off-by: Tao Liu <ltao@redhat.com>
Acked-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
ae0cbdf34a
commit
7de4a0d6c8
@ -31,6 +31,11 @@ is_squash_available()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_zstd_command_available()
|
||||||
|
{
|
||||||
|
[[ -x "$(command -v zstd)" ]]
|
||||||
|
}
|
||||||
|
|
||||||
perror_exit()
|
perror_exit()
|
||||||
{
|
{
|
||||||
derror "$@"
|
derror "$@"
|
||||||
|
@ -70,7 +70,7 @@ Requires: dracut >= 050
|
|||||||
Requires: dracut-network >= 050
|
Requires: dracut-network >= 050
|
||||||
Requires: dracut-squash >= 050
|
Requires: dracut-squash >= 050
|
||||||
Requires: ethtool
|
Requires: ethtool
|
||||||
Requires: zstd
|
Recommends: zstd
|
||||||
Recommends: grubby
|
Recommends: grubby
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
|
BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
|
||||||
|
5
mkdumprd
5
mkdumprd
@ -432,8 +432,13 @@ done <<< "$(kdump_read_conf)"
|
|||||||
handle_default_dump_target
|
handle_default_dump_target
|
||||||
|
|
||||||
if ! have_compression_in_dracut_args; then
|
if ! have_compression_in_dracut_args; then
|
||||||
|
# Here zstd is set as the default compression method. If squash module
|
||||||
|
# is available for dracut, libzstd will be used by mksquashfs. If
|
||||||
|
# squash module is unavailable, command zstd will be used instead.
|
||||||
|
if is_squash_available || is_zstd_command_available; then
|
||||||
add_dracut_arg "--compress" "zstd"
|
add_dracut_arg "--compress" "zstd"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n $extra_modules ]]; then
|
if [[ -n $extra_modules ]]; then
|
||||||
add_dracut_arg "--add-drivers" "$extra_modules"
|
add_dracut_arg "--add-drivers" "$extra_modules"
|
||||||
|
@ -62,9 +62,12 @@ if is_squash_available; then
|
|||||||
_dracut_isolate_args+=(--add squash)
|
_dracut_isolate_args+=(--add squash)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Same as setting zstd in mkdumprd
|
||||||
if ! have_compression_in_dracut_args; then
|
if ! have_compression_in_dracut_args; then
|
||||||
|
if is_squash_available || is_zstd_command_available; then
|
||||||
_dracut_isolate_args+=(--compress zstd)
|
_dracut_isolate_args+=(--compress zstd)
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
|
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
|
||||||
perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability"
|
perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability"
|
||||||
|
Loading…
Reference in New Issue
Block a user