#kernel #kernel-module #build #build-system #install #source #version

build kernel-builder

select kernel version from available sources, build and install

13 unstable releases (3 breaking)

0.4.0 Nov 4, 2024
0.3.0 Jul 21, 2024
0.2.3 Nov 18, 2023
0.2.2 Oct 19, 2023
0.1.3 Mar 25, 2023

#172 in Build Utils

24 downloads per month

Custom license

19KB
388 lines

Kernel Builder

The Kernel Builder is a application written in rust that scans for available kernel sources in a configured directory and allows you to select which kernel to build, as well as install the modules, copy the compiled kernel to the boot partition, as well as generating the necessary initramfs.

Prerequisites

  • Basic knowledge of kernel configuration and compilation
  • to use the initramfs generation you have to enable the dracut feature and dracut has to be installed on your system

Installation

git clone https://github.com/koopa1338/kernel-builder
cd kernel-builder
cargo install --path .

or install it with cargo install from crates.io

cargo install kernel-builder

You also need a config.toml with the needed paths configured in $HOME/.config/kernel-builder/config.toml:

kernel = "/boot/vmlinuz-linux"
initramfs = "/boot/initramfs-linux" # Optional, only needed if `dracut` feature is enabled
kernel-config = "/usr/src/.config"
kernel-src = "/usr/src"

Usage

If correctly setup you should just run kernel-builder, it should ask for root permission if not alread run as root. You can override options by setting environment variables prefixed with KB_. For example to override the kernel path:

KB_KERNEL=/boot/efi/vmlinuz-linux-lts kernel-builder

Contributing

There is still room for improvements, so if you would like to contribute to the project, please feel free to submit a pull request or open an issue.

License

This script is released under the EUPL License. See the LICENSE file for more information.

Dependencies

~5–12MB
~151K SLoC