kernel-install.eclass

Name

kernel-install.eclass -- Installation mechanics for Distribution Kernels

Description

This eclass provides the logic needed to test and install different kinds of Distribution Kernel packages, including both kernels built from source and distributed as binaries. The eclass relies on the ebuild installing a subset of built kernel tree into /usr/src/linux-${PV} containing the kernel image in its standard location and System.map.

The eclass exports src_test, pkg_preinst, pkg_postinst and pkg_postrm.

Supported EAPIs

8

Transitively Provided Eclasses

  • dist-kernel-utils

Exported Phases

  • pkg_config

  • pkg_postrm

  • pkg_preinst

  • pkg_postinst

  • src_test

  • pkg_pretend

Functions

kernel-install_get_qemu_arch

Get appropriate qemu suffix for the current ${ARCH}.

kernel-install_create_init <filename>

Create minimal /sbin/init

kernel-install_create_qemu_image <filename>

Create minimal qemu raw image

kernel-install_test <version> <image> <modules> <config>

Test that the kernel can successfully boot a minimal system image in qemu. <version> is the kernel version, <image> path to the image, <modules> path to module tree, <config> path to the kernel config.

kernel-install_pkg_pretend

Check for missing optional dependencies and output warnings.

kernel-install_src_test

Boilerplate function to remind people to call the tests.

kernel-install_pkg_preinst

Verify whether the kernel has been installed correctly.

kernel-install_extract_from_uki <type> <input> <output>

Extracts kernel image or initrd from an UKI. <type> must be "linux" or "initrd".

kernel-install_install_all <ver>

Install the kernel, initramfs/uki generation is optionally handled by installkernel. This is called from pkg_postinst() and pkg_config(). <ver> is the full kernel version.

kernel-install_pkg_postinst

Build an initramfs for the kernel, install it and update the /usr/src/linux symlink.

kernel-install_pkg_postrm

Clean up the generated initramfs from the removed kernel directory.

kernel-install_pkg_config

Rebuild the initramfs and reinstall the kernel.

kernel-install_compress_modules

Compress modules installed in ED, if USE=modules-compress is enabled.

Variables

KERNEL_IUSE_GENERIC_UKI (SET BEFORE INHERIT)

If set to a non-null value, adds IUSE=generic-uki and required logic to install a generic unified kernel image.

KV_FULL

A string containing the full kernel release version, e.g. '6.9.6-gentoo-dist'. Defaults to ${PV}${KV_LOCALVERSION}, but can be set by the ebuild when this default value does not match the kernel release. kernel-build.eclass sets this to whatever is in the built kernel's kernel.release file.

KV_LOCALVERSION

A string containing the kernel LOCALVERSION, e.g. '-gentoo'. Needs to be set only when installing binary kernels, kernel-build.eclass obtains it from kernel config.

Authors

Michał Górny <mgorny@gentoo.org>

Maintainers

Distribution Kernel Project <dist-kernel@gentoo.org>

Reporting Bugs

Please report bugs via https://bugs.gentoo.org/