From fdf21dccbab633957d3f46ce79f6f037f51229ad Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 30 Oct 2024 19:38:59 +0800 Subject: [PATCH] drm-panic: kernel: Enable SimpleDRM Currently on a LFS system booted via legacy BIOS (intead of UEFI), the users can make two different configurations: 1. The DRM driver for the GPU is built as a module. Then before the module is loaded (i.e. the root fs is properly mounted) the kernel messages are displayed via the VGA console. 2. The DRM driver for the GPU is built into the kernel image. Then the kernel messages are displayed via the DRM-emulated framebuffer console since a very early stage (before the root fs is properly mounted). When the system is booted via UEFI, we use SimpleDRM on the EFI framebuffer for displaying kernel messages, thus it's always the case 2. Both are not good for diagnostic in case the root fs cannot be mounted properly (it's very frequent on lfs-support): - With 1 the VGA console can only fit 80x24 characters, so the relevent information is often flushed away. - With 2 the panic message is often displayed improperly when a DRM driver is running. The "DRM panic" feature introduced since Linux 6.11 (but it'll only become usable for LFS since Linux 6.12) can fix the case 2, while case 1 just cannot be fixed. So start to make LFS booted via legacy BIOS to use method 2 now, then we can enable DRM panic and fix this long-standing issue. --- chapter10/kernel.xml | 4 ++-- chapter10/kernel/kernel.version | 2 +- chapter10/kernel/systemd.toml | 14 +++++--------- chapter10/kernel/systemd.xml | 10 +++++----- chapter10/kernel/sysv.toml | 14 +++++--------- chapter10/kernel/sysv.xml | 11 ++++++----- 6 files changed, 24 insertions(+), 31 deletions(-) diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 4eb87a17b..8155f735c 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -282,8 +282,8 @@ These are needed to display the Linux console on a GPU driven by a DRI (Direct Rendering Infrastructure) driver. - If (Direct Rendering Manager) is - enabled, you should enable these two options as well or you'll see + As (Direct Rendering Manager) is + enabled, we should enable these two options as well or we'll see a blank screen once the DRI driver is loaded. diff --git a/chapter10/kernel/kernel.version b/chapter10/kernel/kernel.version index 22cb9e553..ff61e1868 100644 --- a/chapter10/kernel/kernel.version +++ b/chapter10/kernel/kernel.version @@ -1 +1 @@ -6.10.2 +6.12.1 diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml index bfe7a1b40..649df88d4 100644 --- a/chapter10/kernel/systemd.toml +++ b/chapter10/kernel/systemd.toml @@ -13,7 +13,11 @@ STACKPROTECTOR_STRONG='*' UEVENT_HELPER=' ' DEVTMPFS='*' DEVTMPFS_MOUNT='*' -DRM=' *M' +SYSFB_SIMPLEFB='*' +DRM='*' +DRM_FBDEV_EMULATION='*' +DRM_SIMPLEDRM='*' +FRAMEBUFFER_CONSOLE='*' NET='*' INET='*' IPV6='*' @@ -30,11 +34,3 @@ revision='systemd' [RT_GROUP_SCHED] value = ' ' comment = 'This may cause some systemd features malfunction' - -[DRM_FBDEV_EMULATION] -value = ' *' -comment = 'If [DRM] is selected as * or M, this must be selected' - -[FRAMEBUFFER_CONSOLE] -value = ' *' -comment = 'If [DRM] is selected as * or M, this must be selected' diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml index a03c67402..beff1eb2d 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -42,15 +42,15 @@ ... [FW_LOADER_USER_HELPER] Firmware Drivers ---> [*] Export DMI identification via sysfs to userspace [DMIID] + [*] Mark VGA/VBE/EFI FB as generic system framebuffer [SYSFB_SIMPLEFB] Graphics support ---> - < /*/M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> + <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> ... [DRM] - # If [DRM] is selected as * or M, this must be selected: - [ /*] Enable legacy fbdev support for your modesetting driver + [*] Enable legacy fbdev support for your modesetting driver ... [DRM_FBDEV_EMULATION] + <*> Simple framebuffer driver [DRM_SIMPLEDRM] Console display driver support ---> - # If [DRM] is selected as * or M, this must be selected: - [ /*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] + [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] File systems ---> [*] Inotify support for userspace [INOTIFY_USER] diff --git a/chapter10/kernel/sysv.toml b/chapter10/kernel/sysv.toml index 3f8d2e93c..5f6812821 100644 --- a/chapter10/kernel/sysv.toml +++ b/chapter10/kernel/sysv.toml @@ -12,14 +12,10 @@ STACKPROTECTOR_STRONG='*' UEVENT_HELPER=' ' DEVTMPFS='*' DEVTMPFS_MOUNT='*' -DRM=' *M' +SYSFB_SIMPLEFB='*' +DRM='*' +DRM_FBDEV_EMULATION='*' +DRM_SIMPLEDRM='*' +FRAMEBUFFER_CONSOLE='*' revision='sysv' - -[DRM_FBDEV_EMULATION] -value = ' *' -comment = 'If [DRM] is selected as * or M, this must be selected' - -[FRAMEBUFFER_CONSOLE] -value = ' *' -comment = 'If [DRM] is selected as * or M, this must be selected' diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml index 451898a21..0c1d05e5a 100644 --- a/chapter10/kernel/sysv.xml +++ b/chapter10/kernel/sysv.xml @@ -28,12 +28,13 @@ [*] Maintain a devtmpfs filesystem to mount at /dev [DEVTMPFS] [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs ... [DEVTMPFS_MOUNT] + Firmware Drivers ---> + [*] Mark VGA/VBE/EFI FB as generic system framebuffer [SYSFB_SIMPLEFB] Graphics support ---> - < /*/M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> + <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> ... [DRM] - # If [DRM] is selected as * or M, this must be selected: - [ /*] Enable legacy fbdev support for your modesetting driver + [*] Enable legacy fbdev support for your modesetting driver ... [DRM_FBDEV_EMULATION] + <*> Simple framebuffer driver [DRM_SIMPLEDRM] Console display driver support ---> - # If [DRM] is selected as * or M, this must be selected: - [ /*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] + [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE]