From d9a2b17dec11011e84086aaed913d058c408c337 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 7 Jul 2023 14:16:46 -0400 Subject: [PATCH 1/3] kexec-boot: display kexec command to be executed in DEBUG mode and permit to abort call. --- initrd/bin/kexec-boot | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/initrd/bin/kexec-boot b/initrd/bin/kexec-boot index de59db6ef..6fa88efde 100755 --- a/initrd/bin/kexec-boot +++ b/initrd/bin/kexec-boot @@ -146,6 +146,17 @@ echo "$kexeccmd" eval "$kexeccmd" \ || die "Failed to load the new kernel" +if [ "$CONFIG_DEBUG_OUTPUT" = "y" ];then + #Repeat kexec command that will be executed since in debug + DEBUG "kexeccmd= $kexeccmd" + + read -n 1 -p "[DEBUG] Continue booting? [Y/n]: " debug_boot_confirm + if [ "${debug_boot_confirm^^}" = N ]; then + # abort + die "Boot aborted" + fi +fi + if [ "$CONFIG_TPM" = "y" ]; then tpmr kexec_finalize fi From f289b112900aac82012316c618bcdf6e54dd3b33 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 7 Jul 2023 14:17:55 -0400 Subject: [PATCH 2/3] kexec-insert-key: have output line for Building initrd on a new line --- initrd/bin/kexec-insert-key | 1 + 1 file changed, 1 insertion(+) diff --git a/initrd/bin/kexec-insert-key b/initrd/bin/kexec-insert-key index 78a16faba..95f7a0977 100755 --- a/initrd/bin/kexec-insert-key +++ b/initrd/bin/kexec-insert-key @@ -68,6 +68,7 @@ if [ "$unseal_failed" = "y" ]; then fi fi +echo echo '+++ Building initrd' # pad the initramfs (dracut doesn't pad the last gz blob) # without this the kernel init/initramfs.c fails to read From a3247241722f684b1774c9a03fa93f17dd399fa9 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 7 Jul 2023 14:19:47 -0400 Subject: [PATCH 3/3] kexec-2.0.26.patch: report to user in non-debug context that unsupported fb/drm driver is needed on OS initrd --- patches/kexec-2.0.26.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/kexec-2.0.26.patch b/patches/kexec-2.0.26.patch index 71c84abaf..e2f16c8eb 100644 --- a/patches/kexec-2.0.26.patch +++ b/patches/kexec-2.0.26.patch @@ -83,8 +83,8 @@ index 14263b0..55291d6 100644 + dbgprintf("%s: Reusing video type %d\n", + __func__, real_mode->orig_video_isVGA); } else { -+ dbgprintf("%s: Unknown driver %s, can't provide framebuffer\n", -+ __func__, fix.id); ++ fprintf(stderr, "Unknown driver %s, can't provide framebuffer\n kexec'ed OS will take over console only if %s is provided\n", ++ fix.id, fix.id); real_mode->orig_video_isVGA = 0; close(fd); return 0; @@ -95,7 +95,7 @@ index 14263b0..55291d6 100644 + dbgprintf("%s: Kernel did not provide framebuffer address\n", + __func__); + dbgprintf("%s: Try enabling CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM and " -+ "drm_kms_helper.drm_leak_fbdev_smem\n", ++ "drm_kms_helper.drm_leak_fbdev_smem in kernel command-line options\n", + __func__); + } +