Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/4] kernel-install.eclass: Revert "Add KV_FULL [...]"
Date: Wed, 26 Oct 2022 11:32:40
Message-Id: 20221026113140.3213-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/4] dist-kernel: Improved kernel version logic, take two by "Michał Górny"
1 Reverts: 55a495ad71b0ce1620488f389baddeebc787ee64
2 Signed-off-by: Michał Górny <mgorny@g.o>
3 ---
4 eclass/kernel-install.eclass | 40 +++++++++++++++---------------------
5 1 file changed, 17 insertions(+), 23 deletions(-)
6
7 diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
8 index 06260ed61f23..dc77cb514b1a 100644
9 --- a/eclass/kernel-install.eclass
10 +++ b/eclass/kernel-install.eclass
11 @@ -14,13 +14,20 @@
12 # kinds of Distribution Kernel packages, including both kernels built
13 # from source and distributed as binaries. The eclass relies on the
14 # ebuild installing a subset of built kernel tree into
15 -# /usr/src/linux-${KV_FULL}${KV_LOCALVERSION} containing the kernel
16 -# image in its standard location and System.map.
17 +# /usr/src/linux-${PV} containing the kernel image in its standard
18 +# location and System.map.
19 #
20 # The eclass exports src_test, pkg_postinst and pkg_postrm.
21 # Additionally, the inherited mount-boot eclass exports pkg_pretend.
22 # It also stubs out pkg_preinst and pkg_prerm defined by mount-boot.
23
24 +# @ECLASS_VARIABLE: KV_LOCALVERSION
25 +# @DEFAULT_UNSET
26 +# @DESCRIPTION:
27 +# A string containing the kernel LOCALVERSION, e.g. '-gentoo'.
28 +# Needs to be set only when installing binary kernels,
29 +# kernel-build.eclass obtains it from kernel config.
30 +
31 if [[ ! ${_KERNEL_INSTALL_ECLASS} ]]; then
32
33 case ${EAPI} in
34 @@ -30,19 +37,6 @@ esac
35
36 inherit dist-kernel-utils mount-boot toolchain-funcs
37
38 -# @ECLASS_VARIABLE: KV_FULL
39 -# @DESCRIPTION:
40 -# The "x.y.z[-rcN]" kernel version. The default is derived from PV
41 -# following upstream kernel versioning rules.
42 -: "${KV_FULL:=$(dist-kernel_PV_to_KV "${PV}")}"
43 -
44 -# @ECLASS_VARIABLE: KV_LOCALVERSION
45 -# @DEFAULT_UNSET
46 -# @DESCRIPTION:
47 -# A string containing the kernel LOCALVERSION, e.g. '-gentoo'.
48 -# Needs to be set only when installing binary kernels,
49 -# kernel-build.eclass obtains it from kernel config.
50 -
51 SLOT="${PV}"
52 IUSE="+initramfs test"
53 RESTRICT+="
54 @@ -409,18 +403,18 @@ kernel-install_src_test() {
55 kernel-install_pkg_preinst() {
56 debug-print-function ${FUNCNAME} "${@}"
57
58 - local ver="${KV_FULL}${KV_LOCALVERSION}"
59 + local ver="${PV}${KV_LOCALVERSION}"
60 local kdir="${ED}/usr/src/linux-${ver}"
61 local relfile="${kdir}/include/config/kernel.release"
62 [[ ! -d ${kdir} ]] && die "Kernel directory ${kdir} not installed!"
63 [[ ! -f ${relfile} ]] && die "Release file ${relfile} not installed!"
64 local release="$(<"${relfile}")"
65 - if [[ ${release} != ${KV_FULL}* ]]; then
66 + if [[ ${release} != ${PV}* ]]; then
67 eerror "Kernel release mismatch!"
68 - eerror " expected (KV_FULL): ${KV_FULL}*"
69 - eerror " found: ${release}"
70 + eerror " expected (PV): ${PV}*"
71 + eerror " found: ${release}"
72 eerror "Please verify that you are applying the correct patches."
73 - die "Kernel release mismatch (${release} instead of ${KV_FULL}*)"
74 + die "Kernel release mismatch (${release} instead of ${PV}*)"
75 fi
76 if [[ -L ${EROOT}/lib && ${EROOT}/lib -ef ${EROOT}/usr/lib ]]; then
77 # Adjust symlinks for merged-usr.
78 @@ -482,7 +476,7 @@ kernel-install_install_all() {
79 kernel-install_pkg_postinst() {
80 debug-print-function ${FUNCNAME} "${@}"
81
82 - local ver="${KV_FULL}${KV_LOCALVERSION}"
83 + local ver="${PV}${KV_LOCALVERSION}"
84 kernel-install_update_symlink "${EROOT}/usr/src/linux" "${ver}"
85
86 if [[ -z ${ROOT} ]]; then
87 @@ -506,7 +500,7 @@ kernel-install_pkg_postrm() {
88 debug-print-function ${FUNCNAME} "${@}"
89
90 if [[ -z ${ROOT} ]] && use initramfs; then
91 - local ver="${KV_FULL}${KV_LOCALVERSION}"
92 + local ver="${PV}${KV_LOCALVERSION}"
93 local image_path=$(dist-kernel_get_image_path)
94 ebegin "Removing initramfs"
95 rm -f "${EROOT}/usr/src/linux-${ver}/${image_path%/*}"/initrd{,.uefi} &&
96 @@ -521,7 +515,7 @@ kernel-install_pkg_postrm() {
97 kernel-install_pkg_config() {
98 [[ -z ${ROOT} ]] || die "ROOT!=/ not supported currently"
99
100 - kernel-install_install_all "${KV_FULL}${KV_LOCALVERSION}"
101 + kernel-install_install_all "${PV}${KV_LOCALVERSION}"
102 }
103
104 _KERNEL_INSTALL_ECLASS=1
105 --
106 2.38.1