Custom Kernel for Arch Linux Intallation


Motivation

We want to boot a existing Arch Linux installation with a custom configured manually compiled Linux kernel.
We assume systemd-boot as boot manager.

Steps

  1. Clone Git repository of Linux kernel
  2. Configure and build kernel
    make localyesconfig
    make nconfig # adjust stuff
    make -j$(nproc)
    
  3. Installation
    IDENT=custom
    
    # modules
    make modules
    sudo make modules_install
    
    # kernel
    make bzImage
    cp -v arch/x86/boot/bzImage /boot/vmlinuz-${IDENT}
    
    # initrd
    cp /etc/mkinitcpio.d/linux.preset /etc/mkinitcpio.d/linux-${IDENT}.preset
    mkinitcpio -p linux-${IDENT}
    
  4. Configure bootloader
  5. Reboot
    sudo systemctl reboot --boot-loader-entry=arch-${IDENT}.conf
    

See Also