[PATCH v3 0/3] support tests against Fedora 35 or newer Cloud Base Images
by Coiby Xu
This patch set enables the integration tests (i.e. the test cases in
tests/) for Fedora 35, 36 and 37 cloud base images.
v3:
- use "unmount -R" to umount both the root and boot partition [Kairui]
- add a code comment for the change of root node [Kairui]
- fix the error of using the first partition as boot partition (the
2nd partition is the boot parition) for Fedora >= 35
- specify backing format for "qemu-img create" as required by newer qemu-img
- specify the Fedora version for fedpkg sources
v2:
- check LAST_PARTITION/root/root instead of LAST_PARTITION/root [Kairui]
- improve commit message
Coiby Xu (3):
tests: correctly mount the root and also the boot partitions for
Fedora 35, 36 and rawhide Cloud Base Image
tests: specify the backing format for the backing file when using
qemu-img create
tests: specify the Fedora version when running fedpkg sources
tests/Makefile | 2 +-
tests/scripts/image-init-lib.sh | 31 +++++++++++++++++++++++++++----
2 files changed, 28 insertions(+), 5 deletions(-)
--
2.35.3
1 year, 1 month
[RFC 00/13] reuse NetworkManager connection profiles to set up kdump network
by Coiby Xu
Currently, kexec-tools parses legacy ifcfg-* configuration files or
NetworkManager .nmconnection connection profiles to build up dracut
command line parameters like ip=. Then dracut parses these parameters and
runs nm-initrd-generator to generate NetworkManager connection profiles.
Taking a bonding network as an example, nm-initrd-generator generates two
connections as follows,
$ /usr/libexec/nm-initrd-generator -s -- bootdev=mybond0 rd.neednet kdumpnic=mybond0 bond=mybond0:kdump-eth0
*** Connection 'mybond0' ***
[connection]
id=mybond0
uuid=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
type=bond
autoconnect-retries=1
interface-name=mybond0
multi-connect=1
permissions=
[bond]
mode=balance-rr
[ipv4]
dhcp-timeout=90
dns-search=
method=auto
[ipv6]
addr-gen-mode=eui64
dhcp-timeout=90
dns-search=
method=auto
[proxy]
*** Connection 'kdump-eth0' ***
[connection]
id=kdump-eth0
uuid=ed6a7448-b5f8-4f8a-b718-3e24ea1c924b
type=ethernet
autoconnect-retries=1
interface-name=kdump-eth0
master=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
multi-connect=1
permissions=
slave-type=bond
wait-device-timeout=60000
[ethernet]
mac-address-blacklist=
Later dracut starts NetworkManager to activate these profiles to bring up
the network connections. This way of seting up kdump network is tedious,
error-prone and unncessary. A better way is to directly copy the needed
connection profiles to initrd. A potential benefit of this approach for
the users is they can simply edit the connection profile directly like
changing ipv4.dhcp-timeout instead of being forced to use the hard-coded
value enforced by nm-initrd-generator.
This patch set reuses NetworkManager connection profiles to set up kdump
network. It also reduces the memory consumption of network drivers and
fix other issues at the same time. Here are the bug list that addressed by
this patch set on bugzilla,
- Bug 1962421 - [RHEL-9]"eth0: Failed to rename network interface 3 from 'eth0' to 'kdump-eth0': File exists"
- Bug 2064708 - kdump: mkdumprd: failed to make kdump initrd for bridge network on z15 z/vm
- bugs related to OOM caused by network driver
- Bug 1950282 - shutdown those unneeded network interfaces to save memory for kdump
- Bug 1958587 - the kdump initramfs includes unnecessary NIC drivers for SSH/NFS dumping target
- Bug 1890021 - be2net is using too much memory during kdump
- Bug 1662202 - [RHEL-8.1] aarch64: hpe-apache crashkernel OOM when dump to network targe
Coiby Xu (13):
add function to copy NetworkManage connection profile to the initramfs
support legacy ifcfg
ask NM to wait the network device to be available
don't let NetworkManager manage unneeded network interfaces
stop dracut 35network-manager from running nm-initrd-generator
set up kdump network bridge by directly copying NM connection profile
to initrd
set up kdump bonding network by directly copying NM connection profile
to initrd
fix error for vlan over team network interface
set up kdump vlan network by directly copying NM connection profile to
initrd
set up kdump teaming network by directly copying NM connection profile
to initrd
clean up unneeded code after copying .nmconnection to initrd
address the cases where a NIC has a different name in kdump kernel
simplify setup_znet by copying connection profile to initrd
dracut-kdump.sh | 18 +-
dracut-module-setup.sh | 385 ++++++++++++++---------------------------
2 files changed, 133 insertions(+), 270 deletions(-)
--
2.34.1
1 year, 3 months
[PATCH 00/11] crashkernel=auto: support fadump, reserve extra SWIOTLB memory and remove crashkernel.default
by Coiby Xu
The crashkernel=auto implementation in kernel space has been rejected
upstream [1]. The current user space implementation [2] [3] ships a
crashkernel.default but hasn't supported the swiotlb memory requirement,
custom crashkernel value from user and fadump.
The crashkernel.default implementation seems to be overly
complex,
- the default crashkernel value rarely changes. This is no need to ship
the same crashkernel.default default for every kernel package of a
architecture;
- when deciding the value of crashkernel for a new kernel, the
crashkernel.default of existing kernel is took into consideration
We can simply let the kexec-tools maintain the default crashkernel
values and provide an API for kdump-anacon-addon to query it. And for
a newly installed kernel, we can simply call "kdumpctl reset-crashkernel
KERNELPATH" to set its crashkernel value.
For the unfulfilled requirements,
- crashkernel is introduced to /etc/kdump.conf for the user can set
custom crashkernel value to tell kexec-tools to manage crashkernel
value automatically.
- "kdumpctl reset-crashkernel" has been written for the above
purpose.
- "kdumpctl fadump on/off" is added for supporting fadump.
[1] https://lore.kernel.org/linux-mm/20210507010432.IN24PudKT%25akpm@linux-fo...
[2] https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1171
[3] https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...
Coiby Xu (11):
update default crashkernel value
factor out kdump_get_arch_recommend_crashkernel
provide get_default_crashkernel for kdump_anaconda_addon
introduce crashkernel option to kdump.conf
add a helper function to write a config value to kdump.conf
add a helper function to read kernel cmdline parameter from grubby
--info
rewrite reset_crashkernel to provide more features for the user and to
be called by kernel installation hook
allow to add extra memory to crashkernel string
Reserve extra memory when SME or SEV is active
provide kdumpctl fadump on/off
use "kdumpctl reset-crashkernel KERNELIMAGE" in kernel installation
hook
92-crashkernel.install | 135 +----------------------------
kdump-lib-initramfs.sh | 9 ++
kdump-lib.sh | 95 +++++++++++++++------
kdump.conf | 6 ++
kdump.conf.5 | 7 ++
kdumpctl | 188 ++++++++++++++++++++++++++++++++++++-----
kdumpctl.8 | 16 ++--
7 files changed, 271 insertions(+), 185 deletions(-)
--
2.31.1
1 year, 3 months
Re: Bug in lib/kdump/kdump-lib.sh ... on LVM crypto volumes
by Baoquan He
On 05/25/22 at 09:47pm, John Donnelly wrote:
> On 3/23/22 03:17, Baoquan He wrote:
> > On 03/22/22 at 10:05pm, john.p.donnelly(a)oracle.com wrote:
> > >
> > > Hi
> > >
> > > There is a bug in /lib/kdump/kdump-lib.sh when there are LVM crypto volumes
> > > on the system :
> > >
> > >
> > > Provisioning during the installation. In this case lvm pool is created:
> > > # lvdisplay
> > > --- Logical volume ---
> > > LV Name pool00
> > > VG Name ol
> > > LV UUID LARWgk-Fgdq-naoV-R2eN-ooWQ-mcIF-N34LbR
> > > LV Write Access read/write (activated read only)
> > > LV Creation host, time localhost, 2021-11-16 14:06:22 -0500
> > > LV Pool metadata pool00_tmeta
> > > LV Pool data pool00_tdata
> > > LV Status available
> > > # open 0
> > > LV Size <20.15 GiB
> > > Allocated pool data 27.26%
> > > Allocated metadata 21.96%
> > > Current LE 5158
> > > Segments 1
> > > Allocation inherit
> > > Read ahead sectors auto
> > > - currently set to 8192
> > > Block device 252:5
> > >
> > >
> > >
> > > # kdumpctl rebuild
> > > kdump: Rebuilding /boot/initramfs-86_64kdump.img
> > >
> > >
> > > /lib/kdump/kdump-lib.sh: eval: line 939: syntax error near unexpected token
> > > `;'
> > > /lib/kdump/kdump-lib.sh: eval: line 939: `; echo $TYPE'
> > > /lib/kdump/kdump-lib.sh: eval: line 939: syntax error near unexpected token
> > > `;'
> > > /lib/kdump/kdump-lib.sh: eval: line 939: `; echo $TYPE'
> > > /lib/kdump/kdump-lib.sh: eval: line 939: syntax error near unexpected token
> > > `;'
> > > /lib/kdump/kdump-lib.sh: eval: line 939: `; echo $TYPE'
> > >
> > >
> > >
> > >
> > > # blkid -u filesystem,crypto -o export -- /dev/block/253:0
> > > DEVNAME=/dev/block/253:0
> > > UUID=a5ff3f28-3a29-4353-9a12-2c39e2b6d399
> > > TYPE=ext4
> > >
> > > kexec-tools]# eval "$(blkid -u filesystem,crypto -o export
> > > -- /dev/block/253:0); echo \$TYPE"
> > > ext4
> > >
> > > [ kexec-tools]# blkid -u filesystem,crypto -o export --
> > > /dev/block/11:0
> > > [root@ca-ostest469 kexec-tools]# eval "$(blkid -u filesystem,crypto -o
> > > export
> > > -- /dev/block/11:0); echo \$TYPE"
> > >
> > > bash: syntax error near unexpected token `;'
> > >
> > > so the error is seen if blkid is not able to extract information from block
> > > device
> > >
> > >
> > > The fix :
> > >
> > >
> > >
> > > Applying this patch will avoid printing the error message.
> > >
> > > --- kdump-lib.sh.org 2022-02-03 17:23:48.654000000 -0600
> > > +++ kdump-lib.sh 2022-02-03 17:25:53.962000000 -0600
> > > @@ -936,6 +936,13 @@
> > > {
> > > [[ -b /dev/block/$1 ]] || return 1
> > >
> > > + # If the given device is LVM private, skip.
> > > + blkid -u filesystem,crypto -o export -- /dev/block/$1 > /dev/null
> > > + if [ $? -ne 0 ]
> > > + then
> > > + return 1
> > > + fi
> > > +
> > > local _type=$(eval "$(blkid -u filesystem,crypto -o export --
> > > /dev/block/$1); echo \$TYPE")
> > > [[ $_type == "crypto_LUKS" ]] && echo $1
> > >
> > >
> > >
> > >
> > > It is a non-fatal error. kdumpclt rebuild still works.
> > >
> > > Is there a upstream github for this ? Or a contact you can share ?
> >
> > This is the mailing list where kexec-tools package is maintianed. You
> > can subscribe, send your problem description and finding, our colleages
> > may check it.
> >
> > kexec(a)lists.fedoraproject.org
> >
> > By the way, John, are you working on kexec/kdump maintaining in Oracle
> > linux distros?
> >
> Hi,
>
> This appears to be a dead list . No one ever replies and I can't find it at
> :
>
>
> https://accounts.fedoraproject.org/groups/
>
> ...
>
>
> Your mail to 'kexec(a)lists.fedoraproject.org' with the subject
>
> Re: Bug in lib/kdump/kdump-lib.sh ... on LVM crypto volumes
>
> Is being held until the list moderator can review it for approval.
You subscribed to the list, and got no response?
Hi Dave,
Do you know who is the moderator of the kexec fedora list?
1 year, 3 months
[PATCH] crashkernel: optimize arm64 reserved size if PAGE_SIZE=4k
by Pingfan Liu
The arm64 platform supports either 64KB or 4KB page size. In the case of
4KB page size, the reserved memory size can be aligned to that on
x86_64.
Introducing a new formula for 4KB on arm64, which bases on x86_64 plus
extra 64MB.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
gitlab: https://gitlab.com/coxu/fedora-kexec-tools/-/merge_requests/8
kdump-lib.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index b137c89..ef9bd64 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -853,7 +853,13 @@ kdump_get_arch_recommend_crashkernel()
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
_ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
elif [[ $_arch == "aarch64" ]]; then
- _ck_cmdline="2G-:448M"
+ # 64K page
+ if [[ $(getconf PAGE_SIZE) -eq 65536 ]]; then
+ _ck_cmdline="2G-:448M"
+ else
+ # based on x86 plus extra = 64M
+ _ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
+ fi
elif [[ $_arch == "ppc64le" ]]; then
if [[ $_dump_mode == "fadump" ]]; then
_ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
--
2.31.1
1 year, 3 months
[PATCH v2] sysconfig: use a simple generator script to maintain
by Kairui Song
From: Kairui Song <kasong(a)tencent.com>
These kdump.sysconfig.* files are almost identical with a bit different
in several parameters, just use a simple script to generate them upon
packaging. This should make it easier to maintain, updating a comment or
param for certain arch can be done in one place.
There are some minor differences with the generated version due to some
arch's sysconfig is not up-to-dated, this actually fixed the issue,
to check these differences:
# for arch in aarch64 i386 ppc64 ppc64le s390x x86_64; do
./gen-kdump-sysconfig.sh $arch > kdump.sysconfig.$arch.new
git checkout HEAD^ kdump.sysconfig.$arch &>/dev/null
echo "Diff of arch $arch:"
diff kdump.sysconfig.$arch kdump.sysconfig.$arch.new; echo ""
done; git reset;
Diff of arch aarch64:
> #What is the images extension. Relocatable kernels don't have one
> KDUMP_IMG_EXT=""
Diff of arch i386:
Diff of arch ppc64:
42,43d41
< #Specify the action after failure
<
Diff of arch ppc64le:
42,43d41
< #Specify the action after failure
<
Diff of arch s390x:
26,28d25
< # Any additional /sbin/mkdumprd arguments required.
< MKDUMPRD_ARGS=""
<
Diff of arch x86_64:
Signed-off-by: Kairui Song <kasong(a)tencent.com>
---
Update from V1:
- Use a here doc to include the template inline the script.
- Print a warning for unknown arch.
Thanks to Philipp for these suggestion.
kdump.sysconfig => gen-kdump-sysconfig.sh | 59 +++++++++++++++++++++++
kdump.sysconfig.aarch64 | 53 --------------------
kdump.sysconfig.i386 | 56 ---------------------
kdump.sysconfig.ppc64 | 58 ----------------------
kdump.sysconfig.ppc64le | 58 ----------------------
kdump.sysconfig.s390x | 59 -----------------------
kdump.sysconfig.x86_64 | 56 ---------------------
kexec-tools.spec | 17 ++-----
8 files changed, 64 insertions(+), 352 deletions(-)
rename kdump.sysconfig => gen-kdump-sysconfig.sh (50%)
mode change 100644 => 100755
delete mode 100644 kdump.sysconfig.aarch64
delete mode 100644 kdump.sysconfig.i386
delete mode 100644 kdump.sysconfig.ppc64
delete mode 100644 kdump.sysconfig.ppc64le
delete mode 100644 kdump.sysconfig.s390x
delete mode 100644 kdump.sysconfig.x86_64
diff --git a/kdump.sysconfig b/gen-kdump-sysconfig.sh
old mode 100644
new mode 100755
similarity index 50%
rename from kdump.sysconfig
rename to gen-kdump-sysconfig.sh
index 70ebf04..0fbf0ae
--- a/kdump.sysconfig
+++ b/gen-kdump-sysconfig.sh
@@ -1,3 +1,10 @@
+#!/bin/bash
+# $1: target arch
+
+SED_EXP=""
+
+generate() {
+sed "$SED_EXP" <<EOF
# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
# If no version is specified, then the init script will try to find a
# kdump kernel with the same version number as the running kernel.
@@ -36,6 +43,9 @@ KEXEC_ARGS=""
#What is the image type used for kdump
KDUMP_IMG="vmlinuz"
+#What is the images extension. Relocatable kernels don't have one
+KDUMP_IMG_EXT=""
+
# Logging is controlled by following variables in the first kernel:
# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
@@ -51,3 +61,52 @@ KDUMP_IMG="vmlinuz"
# KDUMP_STDLOGLVL=3
# KDUMP_SYSLOGLVL=0
# KDUMP_KMSGLOGLVL=0
+EOF
+}
+
+update_param()
+{
+ SED_EXP="${SED_EXP}s/^$1=.*$/$1=\"$2\"/;"
+}
+
+case "$1" in
+aarch64)
+ update_param KEXEC_ARGS "-s"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+i386)
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+ppc64)
+ update_param KEXEC_ARGS "--dt-no-old-root"
+ update_param KDUMP_COMMANDLINE_REMOVE \
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
+ ;;
+ppc64le)
+ update_param KEXEC_ARGS "--dt-no-old-root -s"
+ update_param KDUMP_COMMANDLINE_REMOVE \
+ "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
+ ;;
+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"
+ 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"
+ ;;
+x86_64)
+ update_param KEXEC_ARGS "-s"
+ update_param KDUMP_COMMANDLINE_APPEND \
+ "irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0"
+ ;;
+*)
+ echo "Warning: Unknown architecture '$1', using default sysconfig template."
+esac
+
+generate
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
deleted file mode 100644
index 67a2af7..0000000
--- a/kdump.sysconfig.aarch64
+++ /dev/null
@@ -1,53 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory udev.children-max=2 panic=10 swiotlb=noforce novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
deleted file mode 100644
index 7e18c1c..0000000
--- a/kdump.sysconfig.i386
+++ /dev/null
@@ -1,56 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 transparent_hugepage=never novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS=""
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
deleted file mode 100644
index ebb22f6..0000000
--- a/kdump.sysconfig.ppc64
+++ /dev/null
@@ -1,58 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="--dt-no-old-root"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-#Specify the action after failure
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
deleted file mode 100644
index 270a2cf..0000000
--- a/kdump.sysconfig.ppc64le
+++ /dev/null
@@ -1,58 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="--dt-no-old-root -s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-#Specify the action after failure
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
deleted file mode 100644
index 234cfe9..0000000
--- a/kdump.sysconfig.s390x
+++ /dev/null
@@ -1,59 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-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"
-
-# Any additional /sbin/mkdumprd arguments required.
-MKDUMPRD_ARGS=""
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
deleted file mode 100644
index 188ba3c..0000000
--- a/kdump.sysconfig.x86_64
+++ /dev/null
@@ -1,56 +0,0 @@
-# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
-# If no version is specified, then the init script will try to find a
-# kdump kernel with the same version number as the running kernel.
-KDUMP_KERNELVER=""
-
-# The kdump commandline is the command line that needs to be passed off to
-# the kdump kernel. This will likely match the contents of the grub kernel
-# line. For example:
-# KDUMP_COMMANDLINE="ro root=LABEL=/"
-# Dracut depends on proper root= options, so please make sure that appropriate
-# root= options are copied from /proc/cmdline. In general it is best to append
-# command line options using "KDUMP_COMMANDLINE_APPEND=".
-# If a command line is not specified, the default will be taken from
-# /proc/cmdline
-KDUMP_COMMANDLINE=""
-
-# This variable lets us remove arguments from the current kdump commandline
-# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
-
-# This variable lets us append arguments to the current kdump commandline
-# after processed by KDUMP_COMMANDLINE_REMOVE
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 acpi_no_memhotplug transparent_hugepage=never nokaslr hest_disable novmcoredd cma=0 hugetlb_cma=0"
-
-# Any additional kexec arguments required. In most situations, this should
-# be left empty
-#
-# Example:
-# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="-s"
-
-#Where to find the boot image
-#KDUMP_BOOTDIR="/boot"
-
-#What is the image type used for kdump
-KDUMP_IMG="vmlinuz"
-
-#What is the images extension. Relocatable kernels don't have one
-KDUMP_IMG_EXT=""
-
-# Logging is controlled by following variables in the first kernel:
-# - @var KDUMP_STDLOGLVL - logging level to standard error (console output)
-# - @var KDUMP_SYSLOGLVL - logging level to syslog (by logger command)
-# - @var KDUMP_KMSGLOGLVL - logging level to /dev/kmsg (only for boot-time)
-#
-# In the second kernel, kdump will use the rd.kdumploglvl option to set the
-# log level in the above KDUMP_COMMANDLINE_APPEND.
-# - @var rd.kdumploglvl - logging level to syslog (by logger command)
-# - for example: add the rd.kdumploglvl=3 option to KDUMP_COMMANDLINE_APPEND
-#
-# Logging levels: no logging(0), error(1),warn(2),info(3),debug(4)
-#
-# KDUMP_STDLOGLVL=3
-# KDUMP_SYSLOGLVL=0
-# KDUMP_KMSGLOGLVL=0
diff --git a/kexec-tools.spec b/kexec-tools.spec
index db6374c..a63bcda 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -11,10 +11,7 @@ Summary: The kexec/kdump userspace component
Source0: http://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.xz
Source1: kdumpctl
-Source2: kdump.sysconfig
-Source3: kdump.sysconfig.x86_64
-Source4: kdump.sysconfig.i386
-Source5: kdump.sysconfig.ppc64
+Source3: gen-kdump-sysconfig.sh
Source7: mkdumprd
Source8: kdump.conf
Source9: https://github.com/makedumpfile/makedumpfile/archive/%{mkdf_ver}/makedump...
@@ -25,18 +22,15 @@ Source13: 98-kexec.rules
Source14: 98-kexec.rules.ppc64
Source15: kdump.conf.5
Source16: kdump.service
-Source18: kdump.sysconfig.s390x
Source19: https://github.com/lucchouina/eppic/archive/%{eppic_ver}/eppic-%{eppic_sh...
Source20: kdump-lib.sh
Source21: kdump-in-cluster-environment.txt
Source22: kdump-dep-generator.sh
Source23: kdump-lib-initramfs.sh
-Source24: kdump.sysconfig.ppc64le
Source25: kdumpctl.8
Source26: live-image-kdump-howto.txt
Source27: early-kdump-howto.txt
Source28: kdump-udev-throttler
-Source29: kdump.sysconfig.aarch64
Source30: 60-kdump.install
Source31: kdump-logger.sh
Source32: mkfadumprd
@@ -152,6 +146,9 @@ cp %{SOURCE26} .
cp %{SOURCE27} .
cp %{SOURCE34} .
+# Generate sysconfig file
+%{SOURCE3} %{_target_cpu} > kdump.sysconfig
+
make
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
make -C eppic-%{eppic_ver}/libeppic
@@ -183,13 +180,9 @@ install -m 755 build/sbin/vmcore-dmesg $RPM_BUILD_ROOT/usr/sbin/vmcore-dmesg
install -m 644 build/man/man8/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install -m 644 build/man/man8/vmcore-dmesg.8 $RPM_BUILD_ROOT%{_mandir}/man8/
-SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
-[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_arch}
-[ -f $SYSCONFIG ] || SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig
-install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
-
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
+install -m 644 kdump.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8
--
2.35.2
1 year, 3 months
[PATCH v2] kdump-lib: use non-debug kernels first
by Lichen Liu
Kdump uses currently running kernel as default, but when currently
running kernel is a debug kernel, it will consume more memory,
which may cause out-of-memory and fail to collect vmcore.
Now we will try to use non-debug kernels first if possible.
Also extract the logic of determine KDUMP_KERNEL from
prepare_kdump_bootinfo into a function. This function will return
KDUMP_KERNEL given a kernel version.
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
---
Update from V1:
- extract the logic of determine KDUMP_KERNEL from prepare_kdump_bootinfo into a function.
kdump-lib.sh | 63 +++++++++++++++++++++++++++++++++++++---------------
1 file changed, 45 insertions(+), 18 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index b137c89..a39e5b1 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -633,40 +633,67 @@ prepare_kexec_args()
echo "$kexec_args"
}
-#
-# Detect initrd and kernel location, results are stored in global enviromental variables:
-# KDUMP_BOOTDIR, KDUMP_KERNELVER, KDUMP_KERNEL, DEFAULT_INITRD, and KDUMP_INITRD
-#
-# Expectes KDUMP_BOOTDIR, KDUMP_IMG, KDUMP_IMG_EXT, KDUMP_KERNELVER to be loaded from config already
-# and will prefer already set values so user can specify custom kernel/initramfs location
-#
-prepare_kdump_bootinfo()
+# prepare_kdump_kernel <kdump_kernelver>
+# This function return kdump_kernel given a kernel version.
+prepare_kdump_kernel()
{
- local boot_img boot_imglist boot_dirlist boot_initrdlist
- local machine_id dir img default_initrd_base var_target_initrd_dir
-
- if [[ -z $KDUMP_KERNELVER ]]; then
- KDUMP_KERNELVER="$(uname -r)"
- fi
-
+ local kdump_kernelver=$1
+ local boot_dirlist boot_imglist kdump_kernel machine_id
read -r machine_id < /etc/machine-id
+
boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"}
- boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
+ boot_imglist="$KDUMP_IMG-$kdump_kernelver$KDUMP_IMG_EXT $machine_id/$kdump_kernelver/$KDUMP_IMG"
# Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
- if [[ -n $boot_img ]]; then
+ if [[ "$boot_img" == *"$kdump_kernelver" ]]; then
boot_imglist="$boot_img $boot_imglist"
fi
for dir in $boot_dirlist; do
for img in $boot_imglist; do
if [[ -f "$dir/$img" ]]; then
- KDUMP_KERNEL=$(echo "$dir/$img" | tr -s '/')
+ kdump_kernel=$(echo "$dir/$img" | tr -s '/')
break 2
fi
done
done
+ echo "$kdump_kernel"
+}
+
+#
+# Detect initrd and kernel location, results are stored in global enviromental variables:
+# KDUMP_BOOTDIR, KDUMP_KERNELVER, KDUMP_KERNEL, DEFAULT_INITRD, and KDUMP_INITRD
+#
+# Expectes KDUMP_BOOTDIR, KDUMP_IMG, KDUMP_IMG_EXT, KDUMP_KERNELVER to be loaded from config already
+# and will prefer already set values so user can specify custom kernel/initramfs location
+#
+prepare_kdump_bootinfo()
+{
+ local boot_initrdlist nondebug_kernelver debug_kernelver
+ local dir img default_initrd_base var_target_initrd_dir
+
+ if [[ -z $KDUMP_KERNELVER ]]; then
+ KDUMP_KERNELVER="$(uname -r)"
+ nondebug_kernelver="$(echo -n "$KDUMP_KERNELVER" | sed -n -e 's/\(.*\)+debug$/\1/p')"
+ fi
+
+ # Use nondebug kernel if possible, because debug kernel will consume more memory and may oom.
+ if [[ -n $nondebug_kernelver ]]; then
+ dinfo "Trying to use $nondebug_kernelver."
+ debug_kernelver="$KDUMP_KERNELVER"
+ KDUMP_KERNELVER="$nondebug_kernelver"
+ fi
+
+ KDUMP_KERNEL=$(prepare_kdump_kernel "$KDUMP_KERNELVER")
+
+ if ! [[ -e $KDUMP_KERNEL ]]; then
+ if [[ -n $debug_kernelver ]]; then
+ dinfo "Fallback to using debug kernel"
+ KDUMP_KERNELVER="$debug_kernelver"
+ KDUMP_KERNEL=$(prepare_kdump_kernel "$KDUMP_KERNELVER")
+ fi
+ fi
if ! [[ -e $KDUMP_KERNEL ]]; then
derror "Failed to detect kdump kernel location"
--
2.31.1
1 year, 3 months
[PATCH v3 0/3] Add lvm2 thin provision support for kdump
by Tao Liu
Thin provision is a mechanism that you can allocate a lvm volume which has
a large virtual size for file systems but actually in a small physical
size. The physical size can be autoextended in use if thin pool reached a
threshold specified in /etc/lvm/lvm.conf.
There are 2 works should be handled when enable lvm2 thinp for kdump:
1) Check if the dump target device or directory is thinp device.
2) Monitor the thin pool and autoextend its size when it reached the threshold
during kdump.
According to my testing, the memory consumption procedure for lvm2 thinp is the thin pool
size-autoextend phase. For fedora and rhel9, the default crashkernel value is enough. But
for rhel8, the default crashkernel value 1G-4G:160M is not enough, so it should
be handled particularly.
v1 -> v2:
1) Modified the usage of lvs cmd when check if target is lvm2 thinp
device.
2) Removed the sync flag way of mounting for lvm2 thinp target
during kdump, use "sync -f vmcore" to force sync data, and handle
the error if fails.
v2 -> v3:
1) Removed "sync -f vmcore" patch out of the patch set, for it is
addressing an issue which is not specifically to lvm2 thinp support for
kdump.
Tao Liu (3):
Add lvm2 thin provision dump target checker
Add lvm2-monitor.service for kdump when lvm2 thinp enabled
lvm.conf should be check modified if lvm2 thinp enabled
dracut-lvm2-monitor.service | 15 +++++++++++++++
dracut-module-setup.sh | 16 ++++++++++++++++
kdump-lib-initramfs.sh | 20 ++++++++++++++++++++
kdumpctl | 1 +
kexec-tools.spec | 2 ++
5 files changed, 54 insertions(+)
create mode 100644 dracut-lvm2-monitor.service
--
2.33.1
1 year, 3 months
[PATCH] Fix the sync issue for dump_fs
by Tao Liu
Previously the sync for dump_fs is problematic, it always
return success according to man 2 sync. So it cannot detect
the error of the dump target is full and not all of vmcore
data been written back the disk, which will leave the vmcore
imcomplete and report misleading log as "saving vmcore
complete".
In this patch, we will use "sync -f vmcore" instead, which
will return error if syncfs on the dump target fails. In
this way, vmcore sync related failures, such as autoextend
of lvm2 thinpool fails, can be detected and handled properly.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
dracut-kdump.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index f4456a1..343e2b0 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -175,8 +175,14 @@ dump_fs()
_dump_exitcode=$?
if [ $_dump_exitcode -eq 0 ]; then
mv "$_dump_fs_path/vmcore-incomplete" "$_dump_fs_path/vmcore"
- sync
- dinfo "saving vmcore complete"
+ sync -f "$_dump_fs_path/vmcore"
+ _sync_exitcode=$?
+ if [ $_sync_exitcode -eq 0 ]; then
+ dinfo "saving vmcore complete"
+ else
+ derror "sync vmcore failed, exitcode:$_sync_exitcode"
+ return 1
+ fi
else
derror "saving vmcore failed, exitcode:$_dump_exitcode"
return 1
--
2.33.1
1 year, 3 months
[PATCH v2 0/3] selftest: Add lvm2 thin provision selftest
by Tao Liu
This patch set is the follow up of patch set "Add lvm2 thin provision
support for kdump", it indroduces a selftest for lvm2 thinp.
v1 -> v2:
Removed the commented lines within lvm.conf, which making the file
size much smaller.
Tao Liu (3):
selftest: Add lvm2 thin provision for kdump test
selftest: Only iterate the .sh files for test execution
selftest: Add "-F qcow2" for qemu-img cmdline
tests/scripts/image-init-lib.sh | 2 +-
tests/scripts/run-test.sh | 4 +-
.../lvm2-thinp-kdump/0-local-lvm2-thinp.sh | 59 +++++++++++++++++++
.../testcases/lvm2-thinp-kdump/lvm.conf | 5 ++
4 files changed, 67 insertions(+), 3 deletions(-)
create mode 100755 tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
create mode 100644 tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
--
2.33.1
1 year, 4 months