diff --git a/chapter10/grub.xml b/chapter10/grub.xml index 1706ccb3c..00be1d6c0 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -135,6 +135,7 @@ set timeout=5 insmod part_gpt insmod ext2 set root=(hd0,2) +set gfxpayload=1024x768x32 menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" { linux /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro @@ -159,6 +160,14 @@ EOF be needed with some rare configurations. + + The set gfxpayload=1024x768x32 command sets the + resolution and color depth of the VESA framebuffer to be passed to the + kernel. It's necessary for the kernel SimpleDRM driver to use the + VESA framebuffer. You can use a different resolution or color depth + value which better suits for your monitor. + + From GRUB's perspective, the kernel files are relative to the partition used. If you used a separate /boot partition, remove /boot from the above diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index d0dd10889..49c3d1bd0 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -304,6 +304,71 @@ + + + + Display a user-friendly message when a kernel panic occurs + + + + This will make the kernel correctly display the message + in case a kernel panic happens and a running DRM driver + supports to do so. Without this, it would be more + difficult to diagnose a panic: if no DRM driver is running, + we'd be on the VGA console which can only hold 24 lines and + the relevent kernel message is often flushed away; if a DRM + driver is running, the display is often completely messed up + on panic. As of Linux-6.12, none of the dedicated drivers for + mainstream GPU models really supports this, but it's supported by + the Simple framebuffer driver which runs on the + VESA (or EFI) framebuffer before the dedicated GPU driver is + loaded. If the dedicated GPU driver is built as a module + (instead of a part of the kernel image) and no initramfs is + used, this functionality will work just fine before the root + file system is mounted and it's already enough for providing + information about most LFS configuration errors causing a + panic (for example, an incorrect root= + setting in ). + + + + + + + Panic screen formatter + + + + Set this kmsg to make sure the last + kernel messages lines are displayed when a kernel panic happens. + The default, user, would make the kernel show + only a user friendly panic message which is not + helpful on diagnostic. The third choice, + qr_code, would make the kernel to compress + the last kernel message lines into a QR code and display it. + The QR code can hold more message lines than plain text and it + can be decoded with an external device (like a smart phone). + But it requires a Rust compiler that LFS does not provide. + + + + + + + Mark VGA/VBE/EFI FB as generic system framebuffer + and + Simple framebuffer driver + + + These allow to use the VESA framebuffer (or the EFI + framebuffer if booting the LFS system via UEFI) as a DRM device. + The VESA framebuffer will be set up by GRUB (or the EFI + framebuffer will be set up by the UEFI firmware), so the DRM panic + handler can function before the GPU-specific DRM driver is + loaded. + + + @@ -314,8 +379,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 8421878a1..ff61e1868 100644 --- a/chapter10/kernel/kernel.version +++ b/chapter10/kernel/kernel.version @@ -1 +1 @@ -6.10.7 +6.12.1 diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml index bfe7a1b40..387a74b66 100644 --- a/chapter10/kernel/systemd.toml +++ b/chapter10/kernel/systemd.toml @@ -13,7 +13,13 @@ STACKPROTECTOR_STRONG='*' UEVENT_HELPER=' ' DEVTMPFS='*' DEVTMPFS_MOUNT='*' -DRM=' *M' +SYSFB_SIMPLEFB='*' +DRM='*' +DRM_PANIC='*' +DRM_PANIC_SCREEN='kmsg' +DRM_FBDEV_EMULATION='*' +DRM_SIMPLEDRM='*' +FRAMEBUFFER_CONSOLE='*' NET='*' INET='*' IPV6='*' @@ -30,11 +36,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..0525fbd0a 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -42,15 +42,18 @@ ... [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 + [*] 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] 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..c8267a303 100644 --- a/chapter10/kernel/sysv.toml +++ b/chapter10/kernel/sysv.toml @@ -12,14 +12,12 @@ STACKPROTECTOR_STRONG='*' UEVENT_HELPER=' ' DEVTMPFS='*' DEVTMPFS_MOUNT='*' -DRM=' *M' +SYSFB_SIMPLEFB='*' +DRM='*' +DRM_PANIC='*' +DRM_PANIC_SCREEN='kmsg' +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..f90164d65 100644 --- a/chapter10/kernel/sysv.xml +++ b/chapter10/kernel/sysv.xml @@ -28,12 +28,16 @@ [*] 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 + [*] 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] 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]