Gentoo Archives: gentoo-dev

From: Mike Pagano <mpagano@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] kernel-2.eclass: Remove < 2.6 support for kernel headers
Date: Wed, 08 Sep 2021 17:20:20
Message-Id: 9e5656d3-bc7a-2c28-731d-8b27fa61767b@gentoo.org
1 kernel-2.eclass: Remove < 2.6 support for kernel headers
2
3 The functionality removed is only to support kernels
4 < 2.6 These kernels have long been removed from the tree
5
6 Detail:
7 Remove the function compile_headers as it is not called
8 for kernels > 2.6.18 because that's when the build target
9 headers_install was introduced.
10 Remove supporting function compile_headers_tweak_config.
11 Additionally, remove 2.6 support from install_headers.
12
13 Signed-off-by: Mike Pagano <mpagano@g.o>
14 ---
15 eclass/kernel-2.eclass | 112 ++---------------------------------------
16 1 file changed, 5 insertions(+), 107 deletions(-)
17
18 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
19 index ef70e250c..983ba9169 100644
20 --- a/eclass/kernel-2.eclass
21 +++ b/eclass/kernel-2.eclass
22 @@ -759,83 +759,6 @@ unpack_fix_install_path() {
23 sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' "${S}"/Makefile || die
24 }
25
26 -# Compile Functions
27 -
28 -# @FUNCTION: compile_headers
29 -# @USAGE:
30 -# @DESCRIPTION:
31 -# header compilation
32 -
33 -compile_headers() {
34 - env_setup_xmakeopts
35 -
36 - # if we couldnt obtain HOSTCFLAGS from the Makefile,
37 - # then set it to something sane
38 - local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile)
39 - HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer}
40 -
41 - if kernel_is 2 4; then
42 - yes "" | make oldconfig ${xmakeopts}
43 - einfo ">>> make oldconfig complete"
44 - make dep ${xmakeopts}
45 - elif kernel_is 2 6; then
46 - # 2.6.18 introduces headers_install which means we dont need any
47 - # of this crap anymore :D
48 - kernel_is ge 2 6 18 && return 0
49 -
50 - # autoconf.h isnt generated unless it already exists. plus, we have
51 - # no guarantee that any headers are installed on the system...
52 - [[ -f ${EROOT%/}/usr/include/linux/autoconf.h ]] \
53 - || touch include/linux/autoconf.h || die
54 -
55 - # if K_DEFCONFIG isn't set, force to "defconfig"
56 - # needed by mips
57 - if [[ -z ${K_DEFCONFIG} ]]; then
58 - if kernel_is ge 2 6 16; then
59 - case ${CTARGET} in
60 - powerpc64*) K_DEFCONFIG="ppc64_defconfig";;
61 - powerpc*) K_DEFCONFIG="pmac32_defconfig";;
62 - *) K_DEFCONFIG="defconfig";;
63 - esac
64 - else
65 - K_DEFCONFIG="defconfig"
66 - fi
67 - fi
68 -
69 - # if there arent any installed headers, then there also isnt an asm
70 - # symlink in /usr/include/, and make defconfig will fail, so we have
71 - # to force an include path with $S.
72 - HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
73 - ln -sf asm-${KARCH} "${S}"/include/asm || die
74 - cross_pre_c_headers && return 0
75 -
76 - make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})"
77 - if compile_headers_tweak_config; then
78 - yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed"
79 - fi
80 - make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
81 - make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
82 - fi
83 -}
84 -
85 -# @FUNCTION: compile_headers_tweak_config
86 -# @USAGE:
87 -# @DESCRIPTION:
88 -# some targets can be very very picky, so let's finesse the
89 -# .config based upon any info we may have
90 -
91 -compile_headers_tweak_config() {
92 - case ${CTARGET} in
93 - sh*)
94 - sed -i '/CONFIG_CPU_SH/d' .config || die
95 - echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config
96 - return 0;;
97 - esac
98 -
99 - # no changes, so lets do nothing
100 - return 1
101 -}
102 -
103 # install functions
104
105 # @FUNCTION: install_universal
106 @@ -856,36 +779,12 @@ install_universal() {
107 install_headers() {
108 local ddir=$(kernel_header_destdir)
109
110 - # 2.6.18 introduces headers_install which means we dont need any
111 - # of this crap anymore :D
112 - if kernel_is ge 2 6 18; then
113 - env_setup_xmakeopts
114 - emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts}
115 -
116 - # let other packages install some of these headers
117 - rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc...
118 - return 0
119 - fi
120 -
121 - # Do not use "linux/*" as that can cause problems with very long
122 - # $S values where the cmdline to cp is too long
123 - pushd "${S}" >/dev/null || die
124 - dodir ${ddir}/linux
125 - cp -pPR "${S}"/include/linux "${ED%/}"${ddir}/ || die
126 - rm -rf "${ED%/}"${ddir}/linux/modules || die
127 -
128 - dodir ${ddir}/asm
129 - cp -pPR "${S}"/include/asm/* "${ED%/}"${ddir}/asm || die
130 -
131 - if kernel_is 2 6; then
132 - dodir ${ddir}/asm-generic
133 - cp -pPR "${S}"/include/asm-generic/* "${ED%/}"${ddir}/asm-generic || die
134 - fi
135 -
136 - # clean up
137 - find "${D}" -name '*.orig' -exec rm -f {} \; || die
138 + env_setup_xmakeopts
139 + emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts}
140
141 - popd >/dev/null || die
142 + # let other packages install some of these headers
143 + rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc...
144 + return 0
145 }
146
147 # @FUNCTION: install_sources
148 @@ -1479,7 +1378,6 @@ kernel-2_src_prepare() {
149
150 kernel-2_src_compile() {
151 cd "${S}" || die
152 - [[ ${ETYPE} == headers ]] && compile_headers
153
154 if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
155 einfo ">>> Running deblob script ..."
156 --
157 2.32.0

Replies