Skip to content

Latest commit

 

History

History
92 lines (65 loc) · 2.86 KB

File metadata and controls

92 lines (65 loc) · 2.86 KB

Kernel Compilation — Linux 6.19.10

Compiling the kernel is one of the longest steps (20–40 minutes). Start the build and work on other configuration steps while it runs.

All commands run inside the chroot as root.


Step 1 — Extract and clean

cd /sources
tar xf linux-6.19.10.tar.xz
cd linux-6.19.10
make mrproper    # always clean before configuring

Step 2 — Configure the kernel

make menuconfig

A text-based menu opens. Navigate with arrow keys. Press Y to include built-in (<*>), M to build as module (<M>), N to exclude. Press / to search for an option by name.

Required options

The following must be compiled built-in (<*>), not as modules (<M>). A module that is required at boot but not loaded will prevent the system from starting.

Menu path Option Required value
General setup Initial RAM filesystem and RAM disk support [*]
General setup Control Group support (CGROUPS) [*]
General setup Namespaces support — enable all [*]
Processor type → Supported processor families ARMv8-A Ensure enabled
File systems The Extended 4 (ext4) filesystem <*> (built-in, not module)
File systems Tmpfs virtual memory filesystem [*]
File systems Inotify support [*]
File systems → DOS/FAT/EXFAT/NT Filesystems VFAT (Windows-95) fs support <*>
Device Drivers → Generic Driver Options Maintain a devtmpfs filesystem [*]
Device Drivers → Generic Driver Options Automount devtmpfs at /dev [*]
Device Drivers → Virtio drivers Virtio block driver <*> (for VMware virtual disk)
Device Drivers → Virtio drivers Virtio network driver <*>
Device Drivers → Serial ATA and Parallel ATA AHCI SATA support <*>
Networking Networking support [*]
Processor type and features EFI runtime service support [*]

VMware Fusion note: VMware Fusion emulates virtual disks via the virtio or SCSI bus. Make sure the Virtio block driver is built-in. Without it, the kernel cannot find the root filesystem.

Save and exit menuconfig.


Step 3 — Build the kernel

make -j$(nproc)
make modules_install

Step 4 — Install the kernel image

For ARM64, the kernel image is at arch/arm64/boot/Image:

cp -iv arch/arm64/boot/Image /boot/vmlinuz-6.19.10-lfs
cp -iv System.map /boot/System.map-6.19.10
cp -iv .config /boot/config-6.19.10

install -d /usr/share/doc/linux-6.19.10
cp -r Documentation/* /usr/share/doc/linux-6.19.10

Remove the source directory:

cd /sources && rm -rf linux-6.19.10

Checkpoint

Verify before moving on
ls /boot/vmlinuz-6.19.10-lfs exists
ls /lib/modules/6.19.10-lfs/ directory exists and contains .ko files
ls /boot/System.map-6.19.10 exists