Gentoo Archives: gentoo-commits

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