[PATCH v2] s390x: add kdump sysconfig option to use the kexec_file_load() syscall
by Lianbo Jiang
Currently, kernel has supported the kexec_file_load() syscall on s390x,
so I follow this commit:
6a20bd54473e ("kdump-lib: switch to the kexec_file_load() syscall on
x86_64 by default")
And also enable the kexec_file_load() syscall for kdump on s390x by
default.
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
Changes since v1:
[1] Remove the change for arm64 because fedora kernel doesn't support
the file load.
kdump.sysconfig.s390x | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index abd45a2f332d..75ff2a25f37b 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -41,3 +41,9 @@ KDUMP_IMG="vmlinuz"
#What is the images extension. Relocatable kernels don't have one
KDUMP_IMG_EXT=""
+
+# Using kexec file based syscall by default
+#
+# Here, the "on" is the only valid value to enable the kexec file load and
+# anything else is equal to the "off"(disable).
+KDUMP_FILE_LOAD="on"
--
2.17.1
3 years, 5 months
[PATCH] Add a new option 'rd.znet_ifname' in order to use it in udev rules
by Lianbo Jiang
In most cases, it always provides a persistent MAC address. But for
the s390 Arch, sometimes, kernel could run in the LPAR mode and it
doesn't provide a persistent MAC address, which caused the kdump
failure.
Currently, some rules rely on the persistent MAC address, for the
above case, which won't work in kdump kernel because non-persistent
MAC could not match with udev rules.
To fix this issue, need to add a new option 'rd.znet_ifname' in order
to provide extra parameters such as 'ifname' and 'subchannels' for
some rules, which ensures kdump can also work appropriately without
the persistent MAC. Please refer to the following commit in dracut:
872eb69936bd ("95znet: Add a rd.znet_ifname= option")
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
dracut-module-setup.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 685b858d87d8..3a3ceeefeb4f 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -318,13 +318,14 @@ kdump_setup_vlan() {
# $1: netdev name
kdump_setup_znet() {
local _options=""
+ local _netdev=$1
- source_ifcfg_file $1
+ source_ifcfg_file $_netdev
for i in $OPTIONS; do
_options=${_options},$i
done
- echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} > ${initdir}/etc/cmdline.d/30znet.conf
+ echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf
}
kdump_get_ip_route()
--
2.17.1
3 years, 5 months
[PATCH] Don't mark NFS target with version < 4 as noauto
by Kairui Song
If dump target is nfs with version < 4, noauto won't work as
dracut will stop rpc server before starting kdump.sh
So don't mark it as noauto, let dracut setup it properly, kdump.sh will
just use it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
mkdumprd | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index 35f5eed..ef598ed 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -51,7 +51,7 @@ add_dracut_sshkey() {
# caller should ensure $1 is valid and mounted in 1st kernel
to_mount() {
- local _dev=$1 _source _target _fstype _options _mntopts _pdev
+ local _dev=$1 _source _target _fstype _options _mntopts _pdev _noauto
_source=$(findmnt -k -f -n -r -o SOURCE $_dev)
_target=$(get_mntpoint_from_target $_dev)
@@ -82,8 +82,17 @@ to_mount() {
# drop nofail or nobootwait
_options=$(echo $_options | sed 's/\(^\|,\)nofail\($\|,\)/\1/g')
_options=$(echo $_options | sed 's/\(^\|,\)nobootwait\($\|,\)/\1/g')
- # only mount the dump target when needed.
- _options="$_options,noauto"
+
+ # only mount the dump target when needed by kdump.sh
+ _noauto=1
+ if [[ $_fstype == "nfs"* ]]; then
+ if [[ $_fstype != "nfs4" ]] && [[ $_options != *",vers=4"* ]]; then
+ # If dump target is nfs with version < 4, noauto won't work as
+ # dracut will stop rpc server before starting kdump.sh
+ unset _noauto
+ fi
+ fi
+ [[ $_noauto ]] && _options="$_options,noauto"
_mntopts="$_target $_fstype $_options"
#for non-nfs _dev converting to use udev persistent name
--
2.25.1
3 years, 5 months
[PATCH] s390x/arm64: add kdump sysconfig option to use the kexec_file_load() syscall
by Lianbo Jiang
Currently, kernel has supported the kexec_file_load() syscall on s390x,
so I follow this commit:
6a20bd54473e ("kdump-lib: switch to the kexec_file_load() syscall on
x86_64 by default")
And also enable the kexec_file_load() syscall for kdump on s390x by
default.
But for the arm64, only add kdump sysconfig option and disable to use
the kexec_file_load() by default. In the future, also will enable it
once kernel is ready.
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
kdump.sysconfig.aarch64 | 6 ++++++
kdump.sysconfig.s390x | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
index d5d762436eca..fc383049b925 100644
--- a/kdump.sysconfig.aarch64
+++ b/kdump.sysconfig.aarch64
@@ -35,3 +35,9 @@ KEXEC_ARGS=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
+
+# Add kdump sysconfig option to use the kexec_file_load() syscall
+#
+# Here, the "on" is the only valid value to enable the kexec file load and
+# anything else is equal to the "off"(disable).
+KDUMP_FILE_LOAD="off"
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index abd45a2f332d..75ff2a25f37b 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -41,3 +41,9 @@ KDUMP_IMG="vmlinuz"
#What is the images extension. Relocatable kernels don't have one
KDUMP_IMG_EXT=""
+
+# Using kexec file based syscall by default
+#
+# Here, the "on" is the only valid value to enable the kexec file load and
+# anything else is equal to the "off"(disable).
+KDUMP_FILE_LOAD="on"
--
2.17.1
3 years, 5 months
[RFC PATCH 0/6] Support for unmounted dump target
by Kairui Song
This is based on previous clean up patches in:
[PATCH 0/5] Simplify bind mount handling and clean up
Currently kexec-tools always depend on dump target to be mounted, which
caused some inconvenience for setup.
So for user configured target, allow kdump to start and build initramfs
even if target is not mounted.
When a mounted user configured target is used, the behavior is not
changed.
When a unmounted user configured target is used, mkdumprd will look for
corresponding mount info in fstab, and a entry with noauto option is
founded, mkdumprd will try to mount it inplace with optoins specified
in fstab and do basic checks on the device, then umount it.
If there is no fstab entry, mkdumprd will try to mount it in temporary
path with defaults option, do same basic check and umount it.
If there is a fstab entry but "noauto" option is not used, then there
must be some reason that the target device is not mounted, mkdumprd will
error out.
When path based target is used, there is no behavior change.
Some examples:
Example 1, target is mounted
kdump.conf:
nfs 192.168.122.1:/srv/local/nfs
path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31
mount info (from mount command):
192.168.122.1:/srv/local/nfs on /var/mnt/nfs2 type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.122.249,local_lock=none,addr=192.168.122.1)
mkdumprd will just do do basic kdump checks (fs size, path
accisibility), and then build the initramfs using current mount
info (mount point, target and options from current system).
Example 2, target is not mounted, and marked noauto in fstab:
kdump.conf:
nfs 192.168.122.1:/srv/local/nfs
path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31
fstab:
192.168.122.1:/srv/local/nfs /mnt/nfs nfs defaults,noauto 0 0
mkdumprd will try to mount 192.168.122.1:/srv/local/nfs on /mnt/nfs,
do basic kdump checks, and then build the initramfs using mount info
in fstab.
Example 3, target is not mounted, and no entry in fstab:
kdump.conf:
nfs 192.168.122.1:/srv/local/nfs
path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31
fstab or current mount:
No info related to target.
mkdumprd will try to mount 192.168.122.1:/srv/local/nfs on
/tmp/mkdumprd.XXXXXX/target with "mount -o defaults", do basic
kdump checks, and then build the initramfs using defaults
options.
In second kernel, target will be mounted on /kdumproot using
default options.
Kairui Song (6):
Fix the problem that kdump prints redundant /
Add a is_mounted helper
Allow calling mkdumprd from kdumpctl even if targat not mounted
kdump-lib.sh: add fstab failback helper for getting mount info
User get_mount_info to replace findmnt calls
mkdumprd: generate usable kdump initramfs even target is not mounted
kdump-lib-initramfs.sh | 54 ++++++++---------
kdump-lib.sh | 58 +++++++++---------
kdumpctl | 9 +--
mkdumprd | 130 +++++++++++++++++++++++++++++------------
4 files changed, 153 insertions(+), 98 deletions(-)
--
2.24.1
3 years, 5 months
[PATCH] dracut-module-setup.sh: ensure cluster info is ready before query
by Pingfan Liu
There is a race issue between "pcs" and "kdumpctl restart"
-1. set up cluster
-2. Then here comes the command _immediately_ in kdumpctl
But due to some pcs internal mechanism, "pcs cluster cib" can not
fetch the updated info in time.
Fix these issue by forcing the upgrade of cib.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
dracut-module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 7a2c7b4..5f91c89 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -712,6 +712,7 @@ is_localhost() {
get_pcs_fence_kdump_nodes() {
local nodes
+ pcs cluster sync && pcs cluster cib-upgrade
# get cluster nodes from cluster cib, get interface and ip address
nodelist=`pcs cluster cib | xmllint --xpath "/cib/status/node_state/@uname" -`
--
2.7.5
3 years, 5 months