[PATCH] mkdumprd: allow spaces after 'path' config phrase when network dump
by Kazuhito Hagio
Without this patch, when there are two or more spaces after 'path'
configuration phrase with ssh or nfs setting, SAVE_PATH is set to
'/var/crash' in mkdumprd, and in most cases kdump service fails to
start.
ssh kdump(a)192.168.122.1
path /kdump
^^
This behavior would be too sensitive and different from the other
configurations. With this patch, mkdumprd allows such spaces.
Signed-off-by: Kazuhito Hagio <k-hagio(a)ab.jp.nec.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index a6f7fe8..aa0abfd 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -13,7 +13,7 @@ export IN_KDUMP=1
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
-SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
+SAVE_PATH=$(awk '/^path/ {print $2}' $conf_file)
[ -z "$SAVE_PATH" ] && SAVE_PATH=$DEFAULT_PATH
# strip the duplicated "/"
SAVE_PATH=$(echo $SAVE_PATH | tr -s /)
--
2.18.0
1 year
[PATCH v2 0/4] Add selftest for kexec-tools
by Kairui Song
This patch series adds the VM based selftest framework for
Fedora kexec-tools. Currently there are 3 test cases, more could be
added later. And the usage and details are included in the document for
selftest.
This help do quick sanity check of new patches, also help debug issues
when developing kexec-tools.
The test output looks like this:
==== Starting all tests: ====
local-kdump nfs-kdump ssh-kdump
======== Running Test Case local-kdump ========
---- Building image for: 0-local.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.img.log
---- Starting test VM: 0-local.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.output
--------Test finished: local-kdump TEST PASSED
You can retrive the verify the vmcore file using following command:
./scripts/copy-from-image.sh \
/home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.img \
/var/crash/127.0.0.1-2020-07-31-06:58:44/vmcore ./
======== Running Test Case nfs-kdump ========
---- Building image for: 1-client.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.img.log
---- Building image for: 0-server.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.img.log
---- Starting VM: 0-server.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.output
---- Starting test VM: 1-client.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.output
--------Test finished: nfs-kdump TEST PASSED
You can retrive the verify the vmcore file using following command:
./scripts/copy-from-image.sh \
/home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.img \
/srv/nfs/var/crash/192.168.77.62-2020-07-31-07:03:12/vmcore ./
======== Running Test Case ssh-kdump ========
---- Building image for: 1-client.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.img.log
---- Building image for: 0-server.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.img.log
---- Starting VM: 0-server.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.output
---- Starting test VM: 1-client.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.output
--------Test finished: ssh-kdump TEST PASSED
You can retrive the verify the vmcore file using following command:
./scripts/copy-from-image.sh \
/home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.img \
/var/crash/192.168.77.62-2020-07-31-07:05:57/vmcore.flat ./
======== Test results ========
----------------
nfs-kdump: TEST PASSED
----------------
ssh-kdump: TEST PASSED
----------------
local-kdump: TEST PASSED
Update from V1:
- Add a tool and log output to let user know how to retrive the
dumped vmcore
- Fix usage of makedumpfile when extracting dmesg from vmcore to
verify vmcore is valid
- Fix some misc problems found during testing patches using selftest
framework, including Makefile dependency issue
Kairui Song (4):
selftest: Add basic infrastructure to build test image
selftest: Add basic test framework
selftest: Add document for selftests
selftest: Show the path of dumped vmcore on test end
tests/Makefile | 88 ++++++
tests/README | 65 +++++
tests/scripts/build-image.sh | 57 ++++
tests/scripts/build-scripts/base-image.sh | 10 +
.../scripts/build-scripts/test-base-image.sh | 21 ++
tests/scripts/build-scripts/test-image.sh | 21 ++
tests/scripts/copy-from-image.sh | 25 ++
tests/scripts/image-init-lib.sh | 252 ++++++++++++++++++
tests/scripts/kexec-kdump-test/init.sh | 113 ++++++++
.../kexec-kdump-test/kexec-kdump-test.service | 9 +
tests/scripts/kexec-kdump-test/test.sh | 15 ++
tests/scripts/run-test.sh | 146 ++++++++++
tests/scripts/spawn-image-shell.sh | 16 ++
tests/scripts/test-lib.sh | 177 ++++++++++++
.../scripts/testcases/local-kdump/0-local.sh | 32 +++
tests/scripts/testcases/nfs-kdump/0-server.sh | 38 +++
tests/scripts/testcases/nfs-kdump/1-client.sh | 30 +++
tests/scripts/testcases/ssh-kdump/0-server.sh | 34 +++
tests/scripts/testcases/ssh-kdump/1-client.sh | 40 +++
19 files changed, 1189 insertions(+)
create mode 100644 tests/Makefile
create mode 100644 tests/README
create mode 100755 tests/scripts/build-image.sh
create mode 100755 tests/scripts/build-scripts/base-image.sh
create mode 100755 tests/scripts/build-scripts/test-base-image.sh
create mode 100755 tests/scripts/build-scripts/test-image.sh
create mode 100755 tests/scripts/copy-from-image.sh
create mode 100644 tests/scripts/image-init-lib.sh
create mode 100755 tests/scripts/kexec-kdump-test/init.sh
create mode 100644 tests/scripts/kexec-kdump-test/kexec-kdump-test.service
create mode 100755 tests/scripts/kexec-kdump-test/test.sh
create mode 100755 tests/scripts/run-test.sh
create mode 100755 tests/scripts/spawn-image-shell.sh
create mode 100644 tests/scripts/test-lib.sh
create mode 100755 tests/scripts/testcases/local-kdump/0-local.sh
create mode 100755 tests/scripts/testcases/nfs-kdump/0-server.sh
create mode 100755 tests/scripts/testcases/nfs-kdump/1-client.sh
create mode 100755 tests/scripts/testcases/ssh-kdump/0-server.sh
create mode 100755 tests/scripts/testcases/ssh-kdump/1-client.sh
--
2.26.2
2 years, 9 months
[PATCH v2 0/4] Rework kernel image and initrd detection code and install hook
by Kairui Song
This patch series refactor kernel image and initrd detection, fix kdump
service failure on some Fedora machines which use
/boot/<machine-id>/<kver>/vmlinuz as kernel installation destination.
Also cover the atomic corner case properly by refering BOOT_IMAGE=
cmdline param for kernel image location.
Also introduce a kernel install hook to clean up the initramfs properly
on kernel uninstall.
Update from V1:
- Add the kdump initramfs clean up hook to make sure it work with
different kernel installation style.
Kairui Song (4):
Add a kernel install hook to clean up kdump initramfs
early-kdump: Use consistent symbol link for kernel and initramfs
Refactor kernel image and initrd detection code
kdump-lib.sh: Remove is_atomic
60-kdump.install | 30 ++++++++++++
dracut-early-kdump-module-setup.sh | 21 +++-----
dracut-early-kdump.sh | 6 +--
kdump-lib.sh | 78 +++++++++++++++++++++++-------
kdumpctl | 44 ++++++++---------
kexec-tools.spec | 3 ++
6 files changed, 123 insertions(+), 59 deletions(-)
create mode 100755 60-kdump.install
--
2.26.2
2 years, 10 months
[PATCHv3] kdumpctl: exit if either pre.d or post.d is missing
by Pingfan Liu
It is hard to detect the time that /etc/kdump is removed. And this failure
may cause out-of-date kdump.initrd. To keep things simple, just exit if
/etc/kdump/pre.d and post.d does not exist.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf | 12 +++++-------
kdump.conf.5 | 12 +++++-------
kdumpctl | 6 +++---
3 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 9f35e31..9fc0a4f 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -79,10 +79,9 @@
# or script after the vmcore dump process terminates.
# The exit status of the current dump process is fed to
# the executable binary or script as its first argument.
-# If /etc/kdump/post.d directory exists, all files in
-# the directory are collectively sorted and executed in
-# lexical order, before binary or script specified
-# kdump_post parameter is executed.
+# All files under /etc/kdump/post.d are collectively sorted
+# and executed in lexical order, before binary or script
+# specified kdump_post parameter is executed.
#
# kdump_pre <binary | script>
# - Works like the "kdump_post" directive, but instead of running
@@ -90,9 +89,8 @@
# Exit status of this binary is interpreted as follows:
# 0 - continue with dump process as usual
# non 0 - run the final action (reboot/poweroff/halt)
-# If /etc/kdump/pre.d directory exists, all files in
-# the directory are collectively sorted and executed in
-# lexical order, after binary or script specified
+# All files under /etc/kdump/pre.d are collectively sorted and
+# executed in lexical order, after binary or script specified
# kdump_pre parameter is executed.
# Even if the binary or script in /etc/kdump/pre.d directory
# returns non 0 exit status, the processing is continued.
diff --git a/kdump.conf.5 b/kdump.conf.5
index c362963..34c996c 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,10 +109,9 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
-If /etc/kdump/post.d directory exists, All files in
-the directory are collectively sorted and executed in
-lexical order, before binary or script specified
-kdump_post parameter is executed.
+All files under /etc/kdump/post.d are collectively sorted
+and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
@@ -129,9 +128,8 @@ as follows:
.PP
non 0 - run the final action (reboot/poweroff/halt)
.PP
-If /etc/kdump/pre.d directory exists, all files in
-the directory are collectively sorted and executed in
-lexical order, after binary or script specified
+All files under /etc/kdump/pre.d are collectively sorted and
+executed in lexical order, after binary or script specified
kdump_pre parameter is executed.
Even if the binary or script in /etc/kdump/pre.d directory
returns non 0 exit status, the processing is continued.
diff --git a/kdumpctl b/kdumpctl
index 42c11d3..122e065 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -151,7 +151,7 @@ rebuild_initrd()
check_exist()
{
for file in $1; do
- if [ ! -f "$file" ]; then
+ if [ ! -e "$file" ]; then
echo -n "Error: $file not found."; echo
return 1
fi
@@ -385,11 +385,11 @@ check_files_modified()
done
fi
+ # HOOKS is mandatory and need to check the modification time
+ files="$files $HOOKS"
check_exist "$files" && check_executable "$EXTRA_BINS"
[ $? -ne 0 ] && return 2
- # HOOKS only need to check the modification here
- files="$files $HOOKS"
for file in $files; do
if [ -e "$file" ]; then
time_stamp=`stat -c "%Y" $file`
--
2.7.5
2 years, 10 months
[PATCHv2] kdumpctl: warn users not to delete pre.d and post.d
by Pingfan Liu
It is hard to detect the time that /etc/kdump is removed. And this failure
may cause out-of-date kdump.initrd. To keep things simple, just make
/etc/kdump/pre.d and post.d mandotary and warn users to re-create them if
they are be deleted.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf | 12 +++++-------
kdump.conf.5 | 12 +++++-------
kdumpctl | 6 +++---
3 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 9f35e31..9fc0a4f 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -79,10 +79,9 @@
# or script after the vmcore dump process terminates.
# The exit status of the current dump process is fed to
# the executable binary or script as its first argument.
-# If /etc/kdump/post.d directory exists, all files in
-# the directory are collectively sorted and executed in
-# lexical order, before binary or script specified
-# kdump_post parameter is executed.
+# All files under /etc/kdump/post.d are collectively sorted
+# and executed in lexical order, before binary or script
+# specified kdump_post parameter is executed.
#
# kdump_pre <binary | script>
# - Works like the "kdump_post" directive, but instead of running
@@ -90,9 +89,8 @@
# Exit status of this binary is interpreted as follows:
# 0 - continue with dump process as usual
# non 0 - run the final action (reboot/poweroff/halt)
-# If /etc/kdump/pre.d directory exists, all files in
-# the directory are collectively sorted and executed in
-# lexical order, after binary or script specified
+# All files under /etc/kdump/pre.d are collectively sorted and
+# executed in lexical order, after binary or script specified
# kdump_pre parameter is executed.
# Even if the binary or script in /etc/kdump/pre.d directory
# returns non 0 exit status, the processing is continued.
diff --git a/kdump.conf.5 b/kdump.conf.5
index c362963..34c996c 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,10 +109,9 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
-If /etc/kdump/post.d directory exists, All files in
-the directory are collectively sorted and executed in
-lexical order, before binary or script specified
-kdump_post parameter is executed.
+All files under /etc/kdump/post.d are collectively sorted
+and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
@@ -129,9 +128,8 @@ as follows:
.PP
non 0 - run the final action (reboot/poweroff/halt)
.PP
-If /etc/kdump/pre.d directory exists, all files in
-the directory are collectively sorted and executed in
-lexical order, after binary or script specified
+All files under /etc/kdump/pre.d are collectively sorted and
+executed in lexical order, after binary or script specified
kdump_pre parameter is executed.
Even if the binary or script in /etc/kdump/pre.d directory
returns non 0 exit status, the processing is continued.
diff --git a/kdumpctl b/kdumpctl
index 42c11d3..bf79e2d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -151,7 +151,7 @@ rebuild_initrd()
check_exist()
{
for file in $1; do
- if [ ! -f "$file" ]; then
+ if [ ! -f "$file" ] && [ ! -d "$file" ]; then
echo -n "Error: $file not found."; echo
return 1
fi
@@ -385,11 +385,11 @@ check_files_modified()
done
fi
+ # HOOKS is mandatory and need to check the modification time
+ files="$files $HOOKS"
check_exist "$files" && check_executable "$EXTRA_BINS"
[ $? -ne 0 ] && return 2
- # HOOKS only need to check the modification here
- files="$files $HOOKS"
for file in $files; do
if [ -e "$file" ]; then
time_stamp=`stat -c "%Y" $file`
--
2.7.5
2 years, 10 months
[PATCH] kdumpctl: warn users not to delete pre.d and post.d
by Pingfan Liu
It is hard to detect the time that /etc/kdump is removed. And this failure
may cause out-of-date kdump.initrd. To keep things simple, just make
/etc/kdump/pre.d and post.d mandotary and warn users to re-create them if
they are be deleted.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf | 12 ++++++++----
kdump.conf.5 | 12 ++++++++----
kdumpctl | 4 ++++
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 9f35e31..583cc82 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -79,8 +79,10 @@
# or script after the vmcore dump process terminates.
# The exit status of the current dump process is fed to
# the executable binary or script as its first argument.
-# If /etc/kdump/post.d directory exists, all files in
-# the directory are collectively sorted and executed in
+# Besides the directive "kdump_post", there could be some extended
+# scripts in the directory "/etc/kdump/post.d".
+# The directory is mandatory and should not be deleted.
+# All files in it are collectively sorted and executed in
# lexical order, before binary or script specified
# kdump_post parameter is executed.
#
@@ -90,8 +92,10 @@
# Exit status of this binary is interpreted as follows:
# 0 - continue with dump process as usual
# non 0 - run the final action (reboot/poweroff/halt)
-# If /etc/kdump/pre.d directory exists, all files in
-# the directory are collectively sorted and executed in
+# Besides the directive "kdump_pre", there could be some extended
+# scripts in the directory "/etc/kdump/pre.d".
+# The directory is mandatory and should not be deleted.
+# All files in it are collectively sorted and executed in
# lexical order, after binary or script specified
# kdump_pre parameter is executed.
# Even if the binary or script in /etc/kdump/pre.d directory
diff --git a/kdump.conf.5 b/kdump.conf.5
index c362963..b8f2771 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,8 +109,10 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
-If /etc/kdump/post.d directory exists, All files in
-the directory are collectively sorted and executed in
+Besides the directive "kdump_post", there could be some extended
+scripts in the directory "/etc/kdump/post.d".
+The directory is mandatory and should not be deleted.
+All files in it are collectively sorted and executed in
lexical order, before binary or script specified
kdump_post parameter is executed.
.PP
@@ -129,8 +131,10 @@ as follows:
.PP
non 0 - run the final action (reboot/poweroff/halt)
.PP
-If /etc/kdump/pre.d directory exists, all files in
-the directory are collectively sorted and executed in
+Besides the directive "kdump_pre", there could be some extended
+scripts in the directory "/etc/kdump/pre.d".
+The directory is mandatory and should not be deleted.
+All files in it are collectively sorted and executed in
lexical order, after binary or script specified
kdump_pre parameter is executed.
Even if the binary or script in /etc/kdump/pre.d directory
diff --git a/kdumpctl b/kdumpctl
index 42c11d3..43acf10 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -339,6 +339,10 @@ check_files_modified()
EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2`
CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2`
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
+ if [ ! -d /etc/kdump/post.d ] || [ ! -d /etc/kdump/pre.d ]; then
+ echo "/etc/kdump/pre.d and post.d is mandatory, please re-create them before rebuilding"
+ exit
+ fi
if [ -d /etc/kdump/post.d ]; then
for file in /etc/kdump/post.d/*; do
if [ -x "$file" ]; then
--
2.7.5
2 years, 10 months
[PATCH 0/3] Refactor kernel image and initrd detection code
by Kairui Song
This patch series refactor kernel image and initrd detection, fix kdump
service failure on some Fedora machines which use
/boot/<machine-id>/<kver>/vmlinuz as kernel installation destination.
Also cover the atomic corner case properly by refering BOOT_IMAGE=
cmdline param for kernel image location.
Kairui Song (3):
early-kdump: Use consistent symbol link for kernel and initramfs
Refactor kernel image and initrd detection code
kdump-lib.sh: Remove is_atomic
dracut-early-kdump-module-setup.sh | 21 +++-----
dracut-early-kdump.sh | 6 +--
kdump-lib.sh | 78 +++++++++++++++++++++++-------
kdumpctl | 44 ++++++++---------
4 files changed, 90 insertions(+), 59 deletions(-)
--
2.26.2
2 years, 10 months
[PATCH 0/3] Add selftest for kexec-tools
by Kairui Song
This patch series adds the VM based selftest framework for
Fedora kexec-tools. Currently there are 3 test cases, more could be
added later. And the usage and details are included in the document for
selftest.
This help do quick sanity check of new patches, also help debug issues
when developing kexec-tools.
The test output looks like this:
==== Starting all tests: ====
local-kdump nfs-kdump ssh-kdump
======== Running Test Case local-kdump ========
---- Building image for: 0-local.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.img.log
---- Starting test VM: 0-local.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/local-kdump/0-local.output
--------Test finished: local-kdump TEST PASSED
======== Running Test Case nfs-kdump ========
---- Building image for: 1-client.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.img.log
---- Building image for: 0-server.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.img.log
---- Starting VM: 0-server.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/0-server.output
---- Starting test VM: 1-client.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/nfs-kdump/1-client.output
/home/kasong/fedpkg/kexec-tools/tests/scripts/run-test.sh: line 6: kill: (1611239) - No such process
--------Test finished: nfs-kdump TEST PASSED
======== Running Test Case ssh-kdump ========
---- Building image for: 1-client.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.img.log
---- Building image for: 0-server.sh ----
-------- Output image is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.img
-------- Building log is: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.img.log
---- Starting VM: 0-server.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/0-server.output
---- Starting test VM: 1-client.sh ----
-------- Qemu cmdline: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.qemu_cmd
-------- Console log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.console
-------- Test log: /home/kasong/fedpkg/kexec-tools/tests/output/ssh-kdump/1-client.output
/home/kasong/fedpkg/kexec-tools/tests/scripts/run-test.sh: line 6: kill: (1613373) - No such process
--------Test finished: ssh-kdump TEST PASSED
======== Test results ========
----------------
nfs-kdump: TEST PASSED
----------------
ssh-kdump: TEST PASSED
----------------
local-kdump: TEST PASSED
Kairui Song (3):
selftest: Add basic infrastructure to build test image
selftest: Add basic test framework
selftest: Add document for selftests
tests/Makefile | 87 +++++++
tests/README | 65 +++++
tests/scripts/build-image.sh | 57 +++++
tests/scripts/build-scripts/base-image.sh | 11 +
.../scripts/build-scripts/test-base-image.sh | 20 ++
tests/scripts/build-scripts/test-image.sh | 21 ++
tests/scripts/image-init-lib.sh | 241 ++++++++++++++++++
tests/scripts/kexec-kdump-test/init.sh | 102 ++++++++
.../kexec-kdump-test/kexec-kdump-test.service | 9 +
tests/scripts/kexec-kdump-test/test.sh | 15 ++
tests/scripts/run-test.sh | 131 ++++++++++
tests/scripts/spawn-image-shell.sh | 16 ++
tests/scripts/test-lib.sh | 177 +++++++++++++
.../scripts/testcases/local-kdump/0-local.sh | 32 +++
tests/scripts/testcases/nfs-kdump/0-server.sh | 38 +++
tests/scripts/testcases/nfs-kdump/1-client.sh | 30 +++
tests/scripts/testcases/ssh-kdump/0-server.sh | 34 +++
tests/scripts/testcases/ssh-kdump/1-client.sh | 40 +++
18 files changed, 1126 insertions(+)
create mode 100644 tests/Makefile
create mode 100644 tests/README
create mode 100755 tests/scripts/build-image.sh
create mode 100755 tests/scripts/build-scripts/base-image.sh
create mode 100755 tests/scripts/build-scripts/test-base-image.sh
create mode 100755 tests/scripts/build-scripts/test-image.sh
create mode 100644 tests/scripts/image-init-lib.sh
create mode 100755 tests/scripts/kexec-kdump-test/init.sh
create mode 100644 tests/scripts/kexec-kdump-test/kexec-kdump-test.service
create mode 100755 tests/scripts/kexec-kdump-test/test.sh
create mode 100755 tests/scripts/run-test.sh
create mode 100755 tests/scripts/spawn-image-shell.sh
create mode 100644 tests/scripts/test-lib.sh
create mode 100755 tests/scripts/testcases/local-kdump/0-local.sh
create mode 100755 tests/scripts/testcases/nfs-kdump/0-server.sh
create mode 100755 tests/scripts/testcases/nfs-kdump/1-client.sh
create mode 100755 tests/scripts/testcases/ssh-kdump/0-server.sh
create mode 100755 tests/scripts/testcases/ssh-kdump/1-client.sh
--
2.26.2
2 years, 10 months
[PATCHv3 0/3] trival fixes and improvement of pre.d/post.d hooks
by Pingfan Liu
v2 -> v3:
re-arrange the patch sequence.
Fix bug in 'kdumpctl: detect modification of scripts by its
directory's timestamp'
v1 -> v2:
1. [1/4]: using rpm spec to install pre.d and post.d mandatory
2. [4/4]: improve commit log
Pingfan Liu (3):
kexec-tools.spec: make the existence of pre.d and post.d mandatory
module-setup.sh: suppress false alarm
kdumpctl: detect modification of scripts by its directory's timestamp
dracut-module-setup.sh | 4 ++--
kdumpctl | 7 ++++++-
kexec-tools.spec | 6 ++++++
3 files changed, 14 insertions(+), 3 deletions(-)
--
2.25.4
2 years, 10 months
[PATCH] ppc64/kdump: use kexec_file_load when secureboot is enabled
by Hari Bathini
In secure boot mode, kexec_load syscall is disabled. So, if in secure
boot mode, load kdump kernel with kexec_file_load syscall instead.
Signed-off-by: Hari Bathini <hbathini(a)linux.ibm.com>
---
kdump-lib.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index f78e064..f632f65 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -611,6 +611,12 @@ is_secure_boot_enforced()
local secure_boot_file setup_mode_file
local secure_boot_byte setup_mode_byte
+ # On powerpc, os-secureboot-enforcing DT property indicates whether secureboot
+ # is enforced. Return success, if it is found.
+ if [ -f /proc/device-tree/ibm,secureboot/os-secureboot-enforcing ]; then
+ return 0
+ fi
+
secure_boot_file=$(find /sys/firmware/efi/efivars -name SecureBoot-* 2>/dev/null)
setup_mode_file=$(find /sys/firmware/efi/efivars -name SetupMode-* 2>/dev/null)
2 years, 10 months