[PATCH 1/2] Tell nmcli to not escape colon when getting the path of connection profile
by Coiby Xu
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151504
When a NetworManager connection profile contains a colon in the name,
"nmcli --get-values UUID,FILENAME" by default would escape the colon
because a colon is also used for separating the values. In this case,
99kdumpbase fails to get the correct connection profile path,
kdumpctl[5439]: cp: cannot stat '/run/NetworkManager/system-connections/static-52\\\:54\\\:01.nmconnection': No such file or directory
kdumpctl[5440]: sed: can't read /tmp/1977-DRACUT_KDUMP_NM/ifcfg-static-52-54-01: No such file or directory
kdumpctl[5449]: dracut-install: ERROR: installing '/tmp/1977-DRACUT_KDUMP_NM/ifcfg-static-52-54-01' to '/etc/NetworkManager/system-connections/ifcfg-static-52-54-01'
As a result, dumping vmcore to a remote nfs would fail.
In our case of getting connection profile path, there is no need to escape the
colon so pass "-escape no" to nmcli,
[root@localhost ~]# nmcli --get-values UUID,FILENAME c show
659e09c1-a6bd-3549-9be4-a07a1a9a8ffd:/etc/NetworkManager/system-connections/aa\:bb.nmconnection
[root@localhost ~]# nmcli -escape no --get-values UUID,FILENAME c show
659e09c1-a6bd-3549-9be4-a07a1a9a8ffd:/etc/NetworkManager/system-connections/aa:bb.nmconnection
Suggested-by: Beniamino Galvani <bgalvani(a)redhat.com>
Reported-by: Martin Pitt <mpitt(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
dracut-module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ab398414..c8015cb5 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -318,7 +318,9 @@ clone_and_modify_nmconnection() {
# connection profile based on MAC address
_match_nmconnection_by_mac "$_uuid" "$_dev"
- _cloned_nmconnection_file_path=$(nmcli --get-values UUID,FILENAME connection show | sed -n "s/^${_uuid}://p")
+ # If a value contain ":", nmcli by default escape it with "\:" because it
+ # also uses ":" as the delimiter to separate values. In our case, escaping is not needed.
+ _cloned_nmconnection_file_path=$(nmcli --escape no --get-values UUID,FILENAME connection show | sed -n "s/^${_uuid}://p")
_tmp_nmconnection_file_path=$_DRACUT_KDUMP_NM_TMP_DIR/$(basename "$_nmconnection_file_path")
cp "$_cloned_nmconnection_file_path" "$_tmp_nmconnection_file_path"
# change uuid back to old value in case it's refered by other connection
--
2.39.2
1 month, 3 weeks
[PATCH] Install nfsv4-related drivers when users specify nfs dumping via dracut_args
by Coiby Xu
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2140721
Currently, if users specify dumping to nfsv4 target via
dracut_args --mount "<NFS-server-ip>:/var/crash /mnt nfs defaults"
it fails with the following errors,
[ 5.159760] mount[446]: mount.nfs: Protocol not supported
[ 5.164502] systemd[1]: mnt.mount: Mount process exited, code=exited, status=32/n/a
[ 5.167616] systemd[1]: mnt.mount: Failed with result 'exit-code'.
[FAILED] Failed to mount /mnt.
This is because nfsv4-releted drivers are not installed to kdump initrd.
mkdumprd calls dracut with "--hostonly-mode strict". If nfsv4-related
drivers aren't loaded before calling dracut, they won't be installed.
When users specify nfs dumping via dracut_args, kexec-tools won't mount
the nfs fs beforehand hence nfsv4-related drivers won't be installed.
Note dracut only installs the nfs driver i.e. nfsv3 driver for "--mount
... nfs". So also install nfsv4-related drivers when users specify nfs
dumping via dracut_args. Since nfs_layout_nfsv41_files depends on nfsv4,
the nfsv4 driver will be installed automatically.
As for the reason why we support nfs dumping via dracut_args instead of
asking user to use the nfs directive, please refer to commit 74c6f464
("Support special mount information via 'dracut_args'").
Fixes: 4eedcae5 ("dracut-module-setup.sh: don't include multipath-hostonly")
Reported-by: rcheerla(a)redhat.com
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
mkdumprd | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 3e250e02..51ca4f01 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -420,6 +420,15 @@ while read -r config_opt config_val; do
verify_core_collector "$config_val"
;;
dracut_args)
+
+ # When users specify nfs dumping via dracut_args, kexec-tools won't
+ # mount nfs fs beforehand thus nfsv4-related drivers won't be installed
+ # because we call dracut with --hostonly-mode strict. So manually install
+ # nfsv4-related drivers.
+ if [[ $(get_dracut_args_fstype "$config_val") == nfs* ]]; then
+ add_dracut_arg "--add-drivers" nfs_layout_nfsv41_files
+ fi
+
while read -r dracut_arg; do
add_dracut_arg "$dracut_arg"
done <<< "$(echo "$config_val" | xargs -n 1 echo)"
--
2.38.1
2 months, 2 weeks
[PATCH 0/8] Small cleanup and a two fixes
by Philipp Rudo
Hi everybody,
While looking at the code I noticed that it contains some dead functions. This
series removes them. Furthermore it fixes two small bugs.
Thanks
Philipp
Philipp Rudo (8):
kdump-lib-initramfs: harden is_mounted
kdump-lib-initramfs: remove is_fs_dump_target
dracut-module-setup: remove dead source_ifcfg_file
kdump-lib: remove get_nmcli_field_by_conpath
kdump-lib: remove get_nmcli_connection_apath_by_ifname
kdump-lib: remove kdump_get_maj_min
kdump-lib: move is_dracut_mod_omitted to kdumpctl
kdumpctl: fix is_dracut_mod_omitted
dracut-module-setup.sh | 13 ---
kdump-lib-initramfs.sh | 7 +-
kdump-lib.sh | 157 +---------------------------------
kdumpctl | 51 +++++++++++
kexec-tools.spec | 1 +
spec/kdumpctl_general_spec.sh | 48 +++++++++++
6 files changed, 103 insertions(+), 174 deletions(-)
--
2.39.2
2 months, 2 weeks
[PATCH v2] sysconfig: add zfcp.allow_lun_scan to KDUMP_COMMANDLINE_REMOVE on s390
by Philipp Rudo
Probing unnecessary I/O devices wastes memory and in extreme cases can
cause the crashkernel to run OOM. That's why the s390-tools maintain
their own module, 95zdev-kdump [1], that disables auto LUN scanning and
only configures zfcp devices that can be used as dump target. So remove
zfcp.allow_lun_scan from the kernel command line to prevent that we
accidentally overwrite the default set by the module.
[1] https://github.com/ibm-s390-linux/s390-tools/blob/master/zdev/dracut/95zd...
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
---
v1->v2:
* update the commit message to incorporate the comments made by Steffen in the
Bugzilla (https://bugzilla.redhat.com/show_bug.cgi?id=2149846#c12)
gen-kdump-sysconfig.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh
index bc37dee..5a16e92 100755
--- a/gen-kdump-sysconfig.sh
+++ b/gen-kdump-sysconfig.sh
@@ -97,7 +97,7 @@ ppc64le)
s390x)
update_param KEXEC_ARGS "-s"
update_param KDUMP_COMMANDLINE_REMOVE \
- "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot zfcp.allow_lun_scan"
update_param KDUMP_COMMANDLINE_APPEND \
"nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0"
;;
--
2.39.2
2 months, 3 weeks
[PATCH] sysconfig: add zfcp.allow_lun_scan to KDUMP_COMMANDLINE_REMOVE on s390
by Philipp Rudo
Probing unnecessary I/O devices wastes memory and in extreme cases can
cause the crshkernel to run OOM. Thus remove automatic lun scanning on
s390.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
---
gen-kdump-sysconfig.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gen-kdump-sysconfig.sh b/gen-kdump-sysconfig.sh
index bc37dee..5a16e92 100755
--- a/gen-kdump-sysconfig.sh
+++ b/gen-kdump-sysconfig.sh
@@ -97,7 +97,7 @@ ppc64le)
s390x)
update_param KEXEC_ARGS "-s"
update_param KDUMP_COMMANDLINE_REMOVE \
- "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot zfcp.allow_lun_scan"
update_param KDUMP_COMMANDLINE_APPEND \
"nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd vmcp_cma=0 cma=0 hugetlb_cma=0"
;;
--
2.39.2
3 months