Re: [PATCH] kdump-lib.sh: detect secure boot on s390
by Philipp Rudo
Hey Pingfan,
hope the mail is readable. Unfortunately it's the best HyperKitty
allows when you are not subscribed on the list...
>On s390, if Secure-IPL is enabled, then "kexec -s -l" is required.
>Otherwise kdump kernel can not be loaded.
>
>Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
>---
> kdump-lib.sh | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/kdump-lib.sh b/kdump-lib.sh
>index e18c473..e24f74f 100755
>--- a/kdump-lib.sh
>+++ b/kdump-lib.sh
>@@ -612,6 +612,7 @@ is_secure_boot_enforced()
> return 0
> fi
>
>+ # Detect secure boot on x86 and arm64
> 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)
>
>@@ -624,6 +625,12 @@ is_secure_boot_enforced()
> fi
> fi
>
>+ # Detect secure boot on s390x
>+ if [[ -e "/sys/firmware/ipl/has_secure" && "$(cat
>/sys/firmware/ipl/has_secure)" == "1" \
>+ && -e "/sys/firmware/ipl/secure" && "$(cat
>/sys/firmware/ipl/secure)" == "1" ]]; then
>+ return 0
>+ fi
As said off-list the check for has_secure isn't strictly needed as it only shows if
a machine is capable of secure boot. Thus when a system was booted with
secure boot (secure=1) the machine must also support secure boot, i.e.
has_secure=1 (everything else is a bug in the kernel or below).
Anyway the patch looks good and should work.
Thanks
Philipp
>+
> return 1
> }
>
>--
>2.7.5
3 years, 7 months
[PATCH 0/2] Don't drop journalctl content if failure action is "shell"
by Kairui Song
If failure action is set to "shell", user will need more debug info
available in kdump kernel. Especially when serial console is not
available, manually retrieve the log from journalctl is very useful
for debugging kdump issue.
Else, we can still drop journalctl content to save memory assuming
nothing will use it.
Kairui Song (2):
dracut-module-install: Move systemd conf install code to a function
Don't drop journalctl content if failure action is "shell"
dracut-module-setup.sh | 44 +++++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 18 deletions(-)
--
2.26.2
3 years, 7 months
[PATCH v3 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-09-02-05:13:05/vmcore ./
Kernel package verion is: kernel-core-5.6.6-300.fc32.x86_64
======== 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: (2156757) - No such process
--------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-09-02-05:15:24/vmcore ./
Kernel package verion is: kernel-core-5.6.6-300.fc32.x86_64
======== 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: (2158504) - No such process
--------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-09-02-05:16:26/vmcore.flat ./
Kernel package verion is: kernel-core-5.6.6-300.fc32.x86_64
======== Test results ========
----------------
nfs-kdump: TEST PASSED
----------------
ssh-kdump: TEST PASSED
----------------
local-kdump: TEST PASSED
Update from V2:
- Print the kernel version used in VM when vmcore is dumped
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 | 114 ++++++++
.../kexec-kdump-test/kexec-kdump-test.service | 9 +
tests/scripts/kexec-kdump-test/test.sh | 15 ++
tests/scripts/run-test.sh | 148 ++++++++++
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, 1192 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
3 years, 7 months