[PATCHv4 0/4] add support for 64k variant
by Pingfan Liu
6k aarch64 has significant memory consumption more than 4k variant, and
requires an separated crashkernel formula.
This series generates the formula dynamiclly based on the system
environment.
---
v3 -> v4
Introduce parse_kver_from_path() to extract kernel version info
Simplify bash return statement
Pingfan Liu (4):
kdump-lib: Introduce a help function _crashkernel_add()
kdump-lib: Introduce parse_kver_from_path() to get kernel version from
its path name
kdump-lib: add support for 64K aarch64
kdump-lib: Evaluate the memory consumption by smmu and mlx5 separately
kdump-lib.sh | 138 ++++++++++++++++++++++++++++++++++++++++-
kdumpctl | 6 +-
spec/kdump-lib_spec.sh | 20 ++++++
3 files changed, 161 insertions(+), 3 deletions(-)
--
2.31.1
3 months, 2 weeks
[PATCH] kdumpctl: Fix the matching of plus symbol by grep's EREs
by Pingfan Liu
After introducing 64k variant kernel on aarch64, an example kernel name
looks like "vmlinuz-5.14.0-316.el9.aarch64+64k". To match the plus
symbol, it demands an escape charater.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 20ed7bf..5c55a6a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1406,6 +1406,8 @@ _filter_grubby_kernel_str()
_find_kernel_path_by_release()
{
local _release="$1" _grubby_kernel_str _kernel_path
+
+ _release=$(echo "$_release" | sed 's/+/\+/g')
_grubby_kernel_str=$(grubby --info ALL | grep -E "^kernel=.*$_release(\/\w+)?\"$")
_kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str")
if [[ -z $_kernel_path ]]; then
--
2.31.1
4 months
[PATCH v2] mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS
by Coiby Xu
Currently, kdump doesn't work on many FIPS-enabled systems including
Azure, ESXI, Hyper, POWER and etc. When FIPS is enabled, it needs to
access /boot//.vmlinuz-xxx.hmac to verify the integrity of the kernel.
However, on those systems, /boot fails to be mounted due to a lack of
fs and block device drivers and the system just halted after failing to
verify the integrity of the kernel. For example, on Hyper-V, sd_mod, sg,
scsi_transport_fc, hv_storvsc and hv_vmbus need to be installed in order
for /boot to be mounted.
mkdumprd calls dracut with the --no-hostonly-default-device. Following
the documentation (man dracut),
--no-hostonly-default-device
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed
this patch uses "--add-device" to explicitly add the device of /boot.
Note there is already an attempt to fix it in dracut's 01fips module
i.e. via the commit 83651776 ("fips: ensure fs module for /boot is
installed"). Unfortunately it only installs the file system driver e.g.
xfs.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
v2
- address the case where fips-mode-setup doesn't exist
---
mkdumprd | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 63a37a74..3932a1fd 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -463,6 +463,10 @@ if ! is_fadump_capable; then
is_dump_to_rootfs && add_mount "$(to_dev_name "$(get_root_fs_device)")"
add_dracut_arg "--no-hostonly-default-device"
+
+ if fips-mode-setup --is-enabled 2 > /dev/null; then
+ add_dracut_arg --add-device "$(findmnt -n -o SOURCE --target /boot)"
+ fi
fi
dracut "${dracut_args[@]}" "$@"
--
2.40.1
4 months
[PATCH v2 1/3] Let _update_kernel_cmdline return the correct return code
by Coiby Xu
Currently, for non-s390x systems, the return code is 1 even when
_update_kernel_cmdline is correctly executed. This makes callers like
reset_crashkernel_after_update fail to print a message if a kernel has
its crashkernel updated. Fix it by put the code inside if block for
s390x.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
- add comment for this nasty case [Philipp]
---
kdumpctl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 844fdad8..9c109daa 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1445,7 +1445,11 @@ _update_kernel_cmdline()
grubby --args="fadump=$_fadump_val" --update-kernel "$_kernel_path"
fi
fi
- [[ -f /etc/zipl.conf ]] && zipl > /dev/null
+
+ # Don't use "[[ CONDITION ]] && COMMAND" which returns 1 under false CONDITION
+ if [[ -f /etc/zipl.conf ]]; then
+ zipl > /dev/null
+ fi
}
_valid_grubby_kernel_path()
--
2.40.1
4 months
[PATCHv3 0/3] add support for 64k variant
by Pingfan Liu
6k aarch64 has significant memory consumption more than 4k variant, and
requires an separated crashkernel formula.
This series generates the formula dynamiclly based on the system
environment.
v2->v3:
rebase onto Coiby's patch "Simplify the management of the kernel
parameter crashkernel"
set _crashkernel_add()'s boundary aligned on 1MB
fix the bash arithmetic expression
v1->v2:
split out a common function _crashkernel_add()
Pingfan Liu (3):
kdump-lib: Introduce a help function _crashkernel_add()
kdump-lib: add support for 64K aarch64
kdump-lib: Evaluate the memory consumption by smmu and mlx5 separately
kdump-lib.sh | 101 ++++++++++++++++++++++++++++++++++++++++-
kdumpctl | 3 +-
spec/kdump-lib_spec.sh | 20 ++++++++
3 files changed, 122 insertions(+), 2 deletions(-)
--
2.31.1
4 months
[PATCHv2 0/4] add support for 64k variant
by Pingfan Liu
6k aarch64 has significant memory consumption more than 4k variant, and
requires an separated crashkernel formula.
This series generates the formula dynamiclly based on the system
environment.
v1->v2:
split out a common function _crashkernel_add()
Pingfan Liu (4):
kdump-lib: Introduce a help function _crashkernel_add()
unit tests: Add test case for _crashkernel_add()
kdump-lib: add support for 64K aarch64
kdump-lib: Evaluate the memory consumption by smmu and mlx5 separately
kdump-lib.sh | 101 ++++++++++++++++++++++++++++++++++++++++-
kdumpctl | 24 ++++++++++
spec/kdump-lib_spec.sh | 17 +++++++
3 files changed, 141 insertions(+), 1 deletion(-)
--
2.31.1
4 months, 1 week
[PATCH 1/3] Let _update_kernel_cmdline return the correct return code
by Coiby Xu
Currently, for non-s390x systems, the return code is 1 even when
_update_kernel_cmdline is correctly executed. This makes callers like
reset_crashkernel_after_update fail to print a message if a kernel has
its crashkernel updated. Fix it by put the code inside if block for
s390x.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 2c647d6f..edcf2caf 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1357,7 +1357,9 @@ _update_kernel_cmdline()
grubby --args="fadump=$_fadump_val" --update-kernel "$_kernel_path"
fi
fi
- [[ -f /etc/zipl.conf ]] && zipl > /dev/null
+ if [[ -f /etc/zipl.conf ]]; then
+ zipl > /dev/null
+ fi
}
_valid_grubby_kernel_path()
--
2.40.1
4 months, 1 week
[PATCH] kdump-lib: fix the matching pattern for debug-kernel
by Pingfan Liu
On aarch64, a 64k kernel's name looks like:
vmlinuz-5.14.0-300.el9.aarch64+64k and the corresponding debug kernel's
name looks like: vmlinuz-5.14.0-300.el9.aarch64+64k-debug, which ends
with the suffix -debug instead of +debug.
Fix the matching pattern by [+|-]debug
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump-lib.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 75b31b2..20d2d0c 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -523,12 +523,13 @@ _get_kdump_kernel_version()
fi
_version=$(uname -r)
- if [[ ! "$_version" =~ \+debug$ ]]; then
+ if [[ ! "$_version" =~ [+|-]debug$ ]]; then
echo "$_version"
return
fi
_version_nondebug=${_version%+debug}
+ _version_nondebug=${_version_nondebug%-debug}
if [[ -f "$(prepare_kdump_kernel "$_version_nondebug")" ]]; then
dinfo "Use of debug kernel detected. Trying to use $_version_nondebug"
echo "$_version_nondebug"
--
2.31.1
4 months, 1 week
[PATCH] mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS
by Coiby Xu
Currently, kdump doesn't work on many FIPS-enabled systems including
Azure, ESXI, Hyper, POWER and etc. When FIPS is enabled, it needs to
access /boot//.vmlinuz-xxx.hmac to verify the integrity of the kernel.
However, on those systems, /boot fails to be mounted due to a lack of
fs and block device drivers and the system just halted after failing to
verify the integrity of the kernel. For example, on Hyper-V, sd_mod, sg,
scsi_transport_fc, hv_storvsc and hv_vmbus need to be installed in order
for /boot to be mounted.
mkdumprd calls dracut with the --no-hostonly-default-device. Following
the documentation (man dracut),
--no-hostonly-default-device
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed
this patch uses "--add-device" to explicitly add the device of /boot.
Note there is already an attempt to fix it in dracut's 01fips module
i.e. via the commit 83651776 ("fips: ensure fs module for /boot is
installed"). Unfortunately it only installs the file system driver e.g.
xfs.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
mkdumprd | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 63a37a74..1b6ffbfd 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -463,6 +463,10 @@ if ! is_fadump_capable; then
is_dump_to_rootfs && add_mount "$(to_dev_name "$(get_root_fs_device)")"
add_dracut_arg "--no-hostonly-default-device"
+
+ if fips-mode-setup --is-enabled; then
+ add_dracut_arg --add-device "$(findmnt -n -o SOURCE --target /boot)"
+ fi
fi
dracut "${dracut_args[@]}" "$@"
--
2.40.1
4 months, 1 week
[PATCH v2] kdumpctl: Add support for systemd-boot paths
by Jeremy Linton
The default systemd-boot installed kernels on fedora end up in the form:
/boot/efi/36b54597c46383/6.4.0-0.rc0.20230427git6e98b09da931.5.fc39.aarch64/linux
Where the kernel version is a directory containing the kernel (linux)
and the initrd. Thus _find_kernel_path_by release needs to be a bit less
strict and allow some futher characters on the grubby (really bootctl)
output.
Signed-off-by: Jeremy Linton <jeremy.linton(a)arm.com>
---
v1-v2: Change to extended grep regex and add a one or more pattern
to match a single "\filename" following the kernel revision
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 2c647d6..18a7d62 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1318,7 +1318,7 @@ _filter_grubby_kernel_str()
_find_kernel_path_by_release()
{
local _release="$1" _grubby_kernel_str _kernel_path
- _grubby_kernel_str=$(grubby --info ALL | grep "^kernel=.*$_release\"$")
+ _grubby_kernel_str=$(grubby --info ALL | grep -E "^kernel=.*$_release(\/\w+)?\"$")
_kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str")
if [[ -z $_kernel_path ]]; then
ddebug "kernel $_release doesn't exist"
--
2.40.1
4 months, 2 weeks