#kernel #build #install #version #source #builder #system

bin+lib kernel-builder

select kernel version from available sources, build and install

11 releases

0.2.3 Nov 18, 2023
0.2.2 Oct 19, 2023
0.1.9 Jul 30, 2023
0.1.8 Jun 19, 2023
0.1.3 Mar 25, 2023

#221 in Operating systems

48 downloads per month

Custom license

16KB
325 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

TODO

  • support command line options to skip prompts
  • support bootloader update (e.g. update-grub)
  • support genkernel as beside dracut for initramfs
  • before copying to boot folder, backup old kernel and ramfs to fallback version
  • add indicator for current installed kernel version
  • cli flag for opening make menuconfig

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

~3–13MB
~131K SLoC