Post
Linux From Scratch kernel won't boot
Black screen and silent kernel panic
After recovering Ubuntu and restoring the LFS backup up to chapter 7, a difficulty presented in a previous post, I thought the worst was over. I was wrong. The next big challenge was getting the LFS kernel to boot — and it simply showed nothing after configuring, compiling, and copying it to the /boot directory.
The symptom
For context, I was installing version 13.0 with systemd on a partition (/dev/sda4) alongside Ubuntu, on an external XS2000 SSD in a Dell laptop with Intel Raptor Lake-P UHD Graphics. So I had compiled the LFS 6.18.10 kernel, created the entry in Ubuntu's GRUB, and when selecting "Linux From Scratch," the result was always the same:
-
Total black screen, from the start.
-
No boot messages.
-
No visible kernel panic.
-
Nothing, not even with the
init=/bin/bash,console=tty0,earlyprintk=vga,nomodeset,loglevel=7settings in GRUB.
Ubuntu booted normally on the same hardware, which led me to believe the problem wasn't GRUB, the disk, or the BIOS. It was something in the LFS kernel — or in the way it was configured.
I verified that the SSD appeared in Ubuntu as sda (via a USB-SATA bridge), not as nvme. That changed the interpretation quite a bit: the problem probably wasn't a lack of NVMe driver in the LFS kernel, since the device was exposed as sdX.
First hypothesis: video
Since the hardware was Intel Raptor Lake, the first suspicion was the video driver (i915). I tested various configuration combinations in GRUB:
-
nomodeset -
i915.modeset=0 -
i915.enable=0 -
init=/bin/bash -
console=tty0 -
earlyprintk=vga -
loglevel=7
Nothing worked. Total black screen, with no messages at all. Since nothing appeared, I began to suspect that the kernel wasn't even getting to initialize the console. I then tested:
earlyprintk=vga,keep console=tty0 loglevel=7 panic=1 init=/bin/bash
Nothing worked. This suggested that the kernel was hanging before it could show any message — a "silent kernel panic."
Checking disk and filesystem drivers
Even with the SSD appearing as sda, I wanted to make sure the disk and filesystem drivers were enabled in the LFS kernel. So I checked the following parameters in the config:
grep -E 'CONFIG_ATA|CONFIG_AHCI|CONFIG_NVME|CONFIG_EXT4|CONFIG_BTRFS|CONFIG_XFS' .config
Result: CONFIG_ATA=y, CONFIG_EXT4_FS=y — all correct for the sda + ext4 scenario.
A test: using the Ubuntu kernel
After countless attempts, I decided to try a pragmatic approach: use the Ubuntu kernel on LFS. I copied the Ubuntu vmlinuz and initrd to the LFS /boot and created a GRUB entry pointing to them, with root=/dev/sda4.
Result: LFS actually booted. The shell appeared (with init=/bin/bash) and then the normal system.
This confirmed that the problem was the configuration of the LFS 6.18.10 kernel — it wasn't the hardware, it wasn't GRUB, nor the filesystem.
The solution
I set this problem aside and went to take care of other matters. But when I'm faced with a challenge, it keeps hammering away in my head. I'm not one to give up. So I made a fairly simple decision: take a step back and strictly follow what the book recommends in section 10.3 regarding kernel installation: configuration, compilation, and installation.
I started over from scratch: I deleted the kernel source code directory and unpacked the tar to be sure it wouldn't be contaminated. I ran make defconfig, and then make menuconfig. I followed the recommended feature settings very carefully. Then I compiled and installed it to the /boot directory. I rebooted and it worked. I can't say what was incorrect, but following what the project's creators recommend was what worked.
What I learned
-
Kernel configuration is critical and hardware-dependent. A
make localmodconfigmay not catch everything that's needed, especially on newer hardware. -
Using a known working kernel (like Ubuntu's) can be a pragmatic solution when facing a problem. It's not "cheating" — it's a way to diagnose, or to eliminate some points that could be holding you back.
-
Boot parameters are powerful allies for diagnosis (
init=/bin/bash, console=tty0, earlyprintk=vga, loglevel=7, panic=1). -
The problem isn't always what it seems. I suspected video, but the problem was the kernel configuration as a whole.
-
Backups and patience are essential. Having the chapter 7 backup allowed me to try paths without the fear of breaking something that would lead to literally starting over from scratch.
Final reflection
This phase nearly frustrated me, but it was also very instructive. Learning to diagnose a kernel that wouldn't boot — testing parameters, checking drivers, comparing with a known working kernel — gave me a much deeper understanding of how booting works.
And in the end, the solution of restarting the steps described in the book, which now seems the most logical, allowed me to move on to chapter 9 and continue the LFS journey.



Comments
Loading comments…
Leave a comment