diff options
author | David GUGLIELMI <david.guglielmi@gmail.com> | 2020-06-28 16:25:30 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-29 09:16:08 +0200 |
commit | 1ddeca37606e5b752735d8c96c6a50a2e44d07e0 (patch) | |
tree | 1be0004936e65fbfc25099611dd2bec3965a5831 /eclass/kernel-install.eclass | |
parent | media-gfx/scrot: Update live ebuild (diff) | |
download | gentoo-1ddeca37606e5b752735d8c96c6a50a2e44d07e0.tar.gz gentoo-1ddeca37606e5b752735d8c96c6a50a2e44d07e0.tar.bz2 gentoo-1ddeca37606e5b752735d8c96c6a50a2e44d07e0.zip |
kernel-{build,install}.eclass: support Kconfig LOCALVERSION
Signed-off-by: David GUGLIELMI <david.guglielmi@gmail.com>
Closes: https://bugs.gentoo.org/720930
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r-- | eclass/kernel-install.eclass | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index 8065a8f5638e..ab886d28faf0 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -20,6 +20,13 @@ # Additionally, the inherited mount-boot eclass exports pkg_pretend. # It also stubs out pkg_preinst and pkg_prerm defined by mount-boot. +# @ECLASS-VARIABLE: KV_LOCALVERSION +# @DEFAULT_UNSET +# @DESCRIPTION: +# 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. + if [[ ! ${_KERNEL_INSTALL_ECLASS} ]]; then case "${EAPI:-0}" in @@ -311,21 +318,22 @@ kernel-install_pkg_postinst() { if [[ -z ${ROOT} ]]; then mount-boot_pkg_preinst + local ver="${PV}${KV_LOCALVERSION}" local image_path=$(kernel-install_get_image_path) if use initramfs; then # putting it alongside kernel image as 'initrd' makes # kernel-install happier kernel-install_build_initramfs \ - "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" \ - "${PV}" + "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" \ + "${ver}" fi - kernel-install_install_kernel "${PV}" \ - "${EROOT}/usr/src/linux-${PV}/${image_path}" \ - "${EROOT}/usr/src/linux-${PV}/System.map" + kernel-install_install_kernel "${ver}" \ + "${EROOT}/usr/src/linux-${ver}/${image_path}" \ + "${EROOT}/usr/src/linux-${ver}/System.map" fi - kernel-install_update_symlink "${EROOT}/usr/src/linux" "${PV}" + kernel-install_update_symlink "${EROOT}/usr/src/linux" "${ver}" } # @FUNCTION: kernel-install_pkg_prerm @@ -345,10 +353,11 @@ kernel-install_pkg_postrm() { debug-print-function ${FUNCNAME} "${@}" if [[ -z ${ROOT} ]] && use initramfs; then + local ver="${PV}${KV_LOCALVERSION}" local image_path=$(kernel-install_get_image_path) ebegin "Removing initramfs" - rm -f "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" && - find "${EROOT}/usr/src/linux-${PV}" -depth -type d -empty -delete + rm -f "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" && + find "${EROOT}/usr/src/linux-${ver}" -depth -type d -empty -delete eend ${?} fi } @@ -361,18 +370,19 @@ kernel-install_pkg_config() { mount-boot_pkg_preinst + local ver="${PV}${KV_LOCALVERSION}" local image_path=$(kernel-install_get_image_path) if use initramfs; then # putting it alongside kernel image as 'initrd' makes # kernel-install happier kernel-install_build_initramfs \ - "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" \ - "${PV}" + "${EROOT}/usr/src/linux-${ver}/${image_path%/*}/initrd" \ + "${ver}" fi - kernel-install_install_kernel "${PV}" \ - "${EROOT}/usr/src/linux-${PV}/${image_path}" \ - "${EROOT}/usr/src/linux-${PV}/System.map" + kernel-install_install_kernel "${ver}" \ + "${EROOT}/usr/src/linux-${ver}/${image_path}" \ + "${EROOT}/usr/src/linux-${ver}/System.map" } _KERNEL_INSTALL_ECLASS=1 |