From 2349341e3e641bb87b879d5547fc4c4a6275e713 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 1 Dec 2024 17:30:51 +0800 Subject: [PATCH] drm-panic: kernel: Enable DRM_PANIC Since the previous commit, we've ensured the kernel displaying via DRM even in the early stage. Now enable DRM_PANIC so the kernel will correctly show the last lines of the kernel messages in case a panic happens. Tested with an incorrect root= line in 3 configurations: - A QEMU VM booted via BIOS - A real machine booted via BIOS - A real machine booted via UEFI And in all configurations the panic message is correctly dumped. In 1024x768 we can get 48 lines (twice of 24 lines in VGA console). --- chapter10/kernel/systemd.toml | 2 ++ chapter10/kernel/systemd.xml | 7 +++++-- chapter10/kernel/sysv.toml | 2 ++ chapter10/kernel/sysv.xml | 7 +++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml index 649df88d4..387a74b66 100644 --- a/chapter10/kernel/systemd.toml +++ b/chapter10/kernel/systemd.toml @@ -15,6 +15,8 @@ DEVTMPFS='*' DEVTMPFS_MOUNT='*' SYSFB_SIMPLEFB='*' DRM='*' +DRM_PANIC='*' +DRM_PANIC_SCREEN='kmsg' DRM_FBDEV_EMULATION='*' DRM_SIMPLEDRM='*' FRAMEBUFFER_CONSOLE='*' diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml index beff1eb2d..0525fbd0a 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -46,9 +46,12 @@ Graphics support ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> ... [DRM] - [*] Enable legacy fbdev support for your modesetting driver + [*] Display a user-friendly message when a kernel panic occurs + ... [DRM_PANIC] + (kmsg) Panic screen formatter [DRM_PANIC_SCREEN] + [*] Enable legacy fbdev support for your modesetting driver ... [DRM_FBDEV_EMULATION] - <*> Simple framebuffer driver [DRM_SIMPLEDRM] + <*> Simple framebuffer driver [DRM_SIMPLEDRM] Console display driver support ---> [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] diff --git a/chapter10/kernel/sysv.toml b/chapter10/kernel/sysv.toml index 5f6812821..c8267a303 100644 --- a/chapter10/kernel/sysv.toml +++ b/chapter10/kernel/sysv.toml @@ -14,6 +14,8 @@ DEVTMPFS='*' DEVTMPFS_MOUNT='*' SYSFB_SIMPLEFB='*' DRM='*' +DRM_PANIC='*' +DRM_PANIC_SCREEN='kmsg' DRM_FBDEV_EMULATION='*' DRM_SIMPLEDRM='*' FRAMEBUFFER_CONSOLE='*' diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml index 0c1d05e5a..f90164d65 100644 --- a/chapter10/kernel/sysv.xml +++ b/chapter10/kernel/sysv.xml @@ -33,8 +33,11 @@ Graphics support ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> ... [DRM] - [*] Enable legacy fbdev support for your modesetting driver + [*] Display a user-friendly message when a kernel panic occurs + ... [DRM_PANIC] + (kmsg) Panic screen formatter [DRM_PANIC_SCREEN] + [*] Enable legacy fbdev support for your modesetting driver ... [DRM_FBDEV_EMULATION] - <*> Simple framebuffer driver [DRM_SIMPLEDRM] + <*> Simple framebuffer driver [DRM_SIMPLEDRM] Console display driver support ---> [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE]