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_postinst and pkg_postrm. Additionally, the inherited mount-boot eclass exports pkg_pretend. It also stubs out pkg_preinst and pkg_prerm defined by mount-boot.

Supported EAPIs

7 8

Transitively Provided Eclasses

  • dist-kernel-utils

Exported Phases

  • pkg_config

  • pkg_prerm

  • pkg_postrm

  • pkg_preinst

  • pkg_postinst

  • src_test

  • pkg_pretend

Functions

kernel-install_can_update_symlink

Determine whether the symlink at <target> (full path) should be updated. Returns 0 if it should, 1 to leave as-is.

kernel-install_update_symlink <target> <version>

Update the kernel source symlink at <target> (full path) with a link to <target>-<version> if it's either missing or pointing out to an older version of this package.

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>

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.

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_install_all <ver>

Build an initramfs for the kernel and install the kernel. 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_prerm

Stub out mount-boot.eclass.

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.

Variables

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/