dist-kernel-utils.eclass

Name

dist-kernel-utils.eclass -- Utility functions related to Distribution Kernels

Description

This eclass provides various utility functions related to Distribution Kernels.

Supported EAPIs

7 8

Functions

dist-kernel_get_image_path

Get relative kernel image path specific to the current ${ARCH}.

dist-kernel_install_kernel [<version>] [<image>] [<system.map>] [<dir>] [<installkernel-args>...]

Install kernel using installkernel. Takes the following arguments:

<version> -- the target kernel version (default: ${KV_FULL})

<image> -- the full path to the kernel image (default: the image

as reported by dist-kernel_get_image_path() in the ${KV_DIR})

<system.map> -- the full path to the System.map

(default: ${KV_DIR}/System.map})

<dir> -- the target directory to install to (default: ${EROOT}/boot)

<installkernel-args> -- extra optional arguments for installkernel

see man kernel-install and man installkernel. Requires at least version 56 of sys-kernel/installkernel.

dist-kernel_reinstall_initramfs [<kv-dir>] [<kv-full>] [<installkernel-args>...]

Rebuild and install initramfs for the specified dist-kernel. Takes the following arguments:

<kv-dir> -- the full path to the target kernel (default: ${KV_DIR})

<kv-full> -- the target kernel version (default: ${KV_FULL})

<installkernel-args> -- extra optional arguments for installkernel

see man kernel-install and man installkernel. Requires at least version 56 of sys-kernel/installkernel.

This function is to be used in pkg_postinst() of ebuilds installing kernel modules that are included in the initramfs. In order to reinstall all distribution kernels currently installed on the system add the --all argument (requires installkernel-56 or newer).

dist-kernel_PV_to_KV <pv>

Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version.

dist-kernel_get_compressor <kernel_config>

Returns the compressor with arguments for compressing kernel modules based on the CONFIG_MODULES_COMPESS_* setting in the kernel config.

dist-kernel_get_module_suffix <kernel_config>

Returns the suffix for kernel modules based on the CONFIG_MODULES_COMPESS_* setting in the kernel config and USE=modules-compress.

dist-kernel_compressed_module_cleanup <path>

Traverse path for duplicate (un)compressed modules and remove all but the newest variant.

dist-kernel_can_update_src_symlink <target>

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

dist-kernel_update_src_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.

dist-kernel_update_lib_symlinks [<kv-full>] [<image-path>]

Update the symlinks in ${ED}/lib/modules/${KV_FULL} if the system is running merged-usr. Intended to be used in pkg_preinst().

Variables

KERNEL_EFI_ZBOOT

If set to a non-null value, it is assumed the kernel was built with CONFIG_EFI_ZBOOT enabled. This effects the name of the kernel image on arm64 and riscv. Mainly useful for sys-kernel/gentoo-kernel-bin.

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/