/[gentoo-x86]/eclass/kernel-2.eclass
Gentoo

Contents of /eclass/kernel-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.266 - (hide annotations) (download)
Fri Dec 2 01:54:09 2011 UTC (7 years, 6 months ago) by vapier
Branch: MAIN
Changes since 1.265: +7 -13 lines
use `read` to simplify the creation of an array from a string

1 ulm 1.249 # Copyright 1999-2011 Gentoo Foundation
2 johnm 1.13 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.266 # $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.265 2011/12/02 00:15:46 vapier Exp $
4 johnm 1.13
5 johnm 1.54 # Description: kernel.eclass rewrite for a clean base regarding the 2.6
6     # series of kernel with back-compatibility for 2.4
7 johnm 1.3 #
8 phreak 1.206 # Original author: John Mylchreest <johnm@gentoo.org>
9     # Maintainer: kernel-misc@gentoo.org
10 johnm 1.3 #
11     # Please direct your bugs to the current eclass maintainer :)
12 johnm 1.1
13     # added functionality:
14     # unipatch - a flexible, singular method to extract, add and remove patches.
15    
16 johnm 1.54 # A Couple of env vars are available to effect usage of this eclass
17 johnm 1.1 # These are as follows:
18     #
19 johnm 1.93 # K_USEPV - When setting the EXTRAVERSION variable, it should
20     # add PV to the end.
21     # this is useful for thigns like wolk. IE:
22     # EXTRAVERSION would be something like : -wolk-4.19-r1
23 johnm 1.55 # K_NOSETEXTRAVERSION - if this is set then EXTRAVERSION will not be
24     # automatically set within the kernel Makefile
25     # K_NOUSENAME - if this is set then EXTRAVERSION will not include the
26     # first part of ${PN} in EXTRAVERSION
27 robbat2 1.163 # K_NOUSEPR - if this is set then EXTRAVERSION will not include the
28     # anything based on ${PR}.
29 lu_zero 1.62 # K_PREPATCHED - if the patchset is prepatched (ie: mm-sources,
30     # ck-sources, ac-sources) it will use PR (ie: -r5) as
31     # the patchset version for
32 johnm 1.93 # and not use it as a true package revision
33 johnm 1.55 # K_EXTRAEINFO - this is a new-line seperated list of einfo displays in
34 lu_zero 1.62 # postinst and can be used to carry additional postinst
35 johnm 1.55 # messages
36 zlin 1.208 # K_EXTRAELOG - same as K_EXTRAEINFO except using elog instead of einfo
37     # K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn instead of einfo
38 johnm 1.107 # K_SYMLINK - if this is set, then forcably create symlink anyway
39 plasmaroo 1.105 #
40 johnm 1.108 # K_DEFCONFIG - Allow specifying a different defconfig target.
41     # If length zero, defaults to "defconfig".
42 dsd 1.126 # K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any
43     # combination of "base" and "extras"
44     # K_GENPATCHES_VER - The version of the genpatches tarball(s) to apply.
45     # A value of "5" would apply genpatches-2.6.12-5 to
46     # my-sources-2.6.12.ebuild
47 dsd 1.200 # K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
48 robbat2 1.230 # K_DEBLOB_AVAILABLE - A value of "0" will disable all of the optional deblob
49     # code. If empty, will be set to "1" if deblobbing is
50     # possible. Test ONLY for "1".
51     # K_PREDEBLOBBED - This kernel was already deblobbed elsewhere.
52     # If false, either optional deblobbing will be available
53     # or the license will note the inclusion of freedist
54     # code.
55 mpagano 1.244 # K_LONGTERM - If set, the eclass will search for the kernel source
56 ulm 1.249 # in the long term directories on the upstream servers
57 mpagano 1.244 # as the location has been changed by upstream
58 johnm 1.55 # H_SUPPORTEDARCH - this should be a space separated list of ARCH's which
59     # can be supported by the headers ebuild
60    
61     # UNIPATCH_LIST - space delimetered list of patches to be applied to the
62     # kernel
63     # UNIPATCH_EXCLUDE - an addition var to support exlusion based completely
64     # on "<passedstring>*" and not "<passedno#>_*"
65 lu_zero 1.62 # - this should _NOT_ be used from the ebuild as this is
66 johnm 1.55 # reserved for end users passing excludes from the cli
67 lu_zero 1.62 # UNIPATCH_DOCS - space delimemeted list of docs to be installed to
68 johnm 1.55 # the doc dir
69 lu_zero 1.62 # UNIPATCH_STRICTORDER - if this is set places patches into directories of
70 johnm 1.55 # order, so they are applied in the order passed
71 johnm 1.1
72 phreak 1.192 inherit eutils toolchain-funcs versionator multilib
73 mpagano 1.256 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
74 johnm 1.1
75 dostrow 1.132 # Added by Daniel Ostrow <dostrow@gentoo.org>
76     # This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
77     # I will remove it when I come up with something more reasonable.
78 vapier 1.189 [[ ${PROFILE_ARCH} == "ppc64" ]] && CHOST="powerpc64-${CHOST#*-}"
79 dostrow 1.132
80 vapier 1.75 export CTARGET=${CTARGET:-${CHOST}}
81 hollow 1.96 if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
82 hollow 1.95 export CTARGET=${CATEGORY/cross-}
83 vapier 1.75 fi
84 vapier 1.60
85 phreak 1.181 HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}"
86 robbat2 1.225 [[ -z ${LICENSE} ]] && \
87 robbat2 1.229 LICENSE="GPL-2"
88 johnm 1.1
89 robbat2 1.231 # This is the latest KV_PATCH of the deblob tool available from the
90 robbat2 1.243 # libre-sources upstream. If you bump this, you MUST regenerate the Manifests
91     # for ALL kernel-2 consumer packages where deblob is available.
92 mpagano 1.248 [[ -z ${DEBLOB_MAX_VERSION} ]] && DEBLOB_MAX_VERSION=38
93 robbat2 1.231
94 brix 1.178 # No need to run scanelf/strip on kernel sources/headers (bug #134453).
95     RESTRICT="binchecks strip"
96    
97 johnm 1.18 # set LINUX_HOSTCFLAGS if not already set
98 vapier 1.136 [[ -z ${LINUX_HOSTCFLAGS} ]] && \
99 johnm 1.93 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
100 johnm 1.18
101 robbat2 1.163 # debugging functions
102     #==============================================================
103     # this function exists only to help debug kernel-2.eclass
104     # if you are adding new functionality in, put a call to it
105     # at the start of src_unpack, or during SRC_URI/dep generation.
106     debug-print-kernel2-variables() {
107 robbat2 1.228 for v in PVR CKV OKV KV KV_FULL KV_MAJOR KV_MINOR KV_PATCH RELEASETYPE \
108     RELEASE UNIPATCH_LIST_DEFAULT UNIPATCH_LIST_GENPATCHES \
109 mpagano 1.259 UNIPATCH_LIST S KERNEL_URI K_WANT_GENPATCHES ; do
110 robbat2 1.228 debug-print "${v}: ${!v}"
111     done
112 robbat2 1.163 }
113    
114 johnm 1.54 #Eclass functions only from here onwards ...
115 plasmaroo 1.33 #==============================================================
116 dsd 1.126 handle_genpatches() {
117     local tarball
118 vapier 1.218 [[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1
119 dsd 1.126
120 mpagano 1.254 debug-print "Inside handle_genpatches"
121 vapier 1.266 local OKV_ARRAY
122     IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
123 mpagano 1.254
124     # for > 3.0 kernels, handle genpatches tarball name
125     # genpatches for 3.0 and 3.0.1 might be named
126     # genpatches-3.0-1.base.tar.bz2 and genpatches-3.0-2.base.tar.bz2
127     # respectively. Handle this.
128    
129 dsd 1.126 for i in ${K_WANT_GENPATCHES} ; do
130 mpagano 1.254 if [[ ${KV_MAJOR} -ge 3 ]]; then
131     if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
132     tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.bz2"
133     else
134     tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.bz2"
135     fi
136     else
137 dsd 1.126 tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.bz2"
138 mpagano 1.254 fi
139     debug-print "genpatches tarball: $tarball"
140     GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}"
141     UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}"
142 dsd 1.126 done
143     }
144    
145 johnm 1.117 detect_version() {
146     # this function will detect and set
147     # - OKV: Original Kernel Version (2.6.0/2.6.0-test11)
148     # - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
149     # - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
150    
151     if [[ -n ${KV_FULL} ]]; then
152     # we will set this for backwards compatibility.
153     KV=${KV_FULL}
154    
155     # we know KV_FULL so lets stop here. but not without resetting S
156     S=${WORKDIR}/linux-${KV_FULL}
157     return
158     fi
159    
160     # CKV is used as a comparison kernel version, which is used when
161     # PV doesnt reflect the genuine kernel version.
162     # this gets set to the portage style versioning. ie:
163     # CKV=2.6.11_rc4
164     CKV=${CKV:-${PV}}
165     OKV=${OKV:-${CKV}}
166     OKV=${OKV/_beta/-test}
167     OKV=${OKV/_rc/-rc}
168     OKV=${OKV/-r*}
169     OKV=${OKV/_p*}
170    
171     KV_MAJOR=$(get_version_component_range 1 ${OKV})
172 mpagano 1.254 # handle if OKV is X.Y or X.Y.Z (e.g. 3.0 or 3.0.1)
173 vapier 1.266 local OKV_ARRAY
174     IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
175 johnm 1.117
176 mpagano 1.252 # if KV_MAJOR >= 3, then we have no more KV_MINOR
177 mpagano 1.254 #if [[ ${KV_MAJOR} -lt 3 ]]; then
178     if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
179 mpagano 1.253 KV_MINOR=$(get_version_component_range 2 ${OKV})
180 mpagano 1.252 KV_PATCH=$(get_version_component_range 3 ${OKV})
181     if [[ ${KV_MAJOR}${KV_MINOR}${KV_PATCH} -ge 269 ]]; then
182     KV_EXTRA=$(get_version_component_range 4- ${OKV})
183     KV_EXTRA=${KV_EXTRA/[-_]*}
184     else
185     KV_PATCH=$(get_version_component_range 3- ${OKV})
186     fi
187     else
188     KV_PATCH=$(get_version_component_range 2 ${OKV})
189     KV_EXTRA=$(get_version_component_range 3- ${OKV})
190 johnm 1.117 KV_EXTRA=${KV_EXTRA/[-_]*}
191     fi
192 mpagano 1.252
193 mpagano 1.254 debug-print "KV_EXTRA is ${KV_EXTRA}"
194    
195 johnm 1.117 KV_PATCH=${KV_PATCH/[-_]*}
196 ulm 1.249
197 robbat2 1.234 local v n=0 missing
198 mpagano 1.254 #if [[ ${KV_MAJOR} -lt 3 ]]; then
199     if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
200 mpagano 1.252 for v in CKV OKV KV_{MAJOR,MINOR,PATCH} ; do
201     [[ -z ${!v} ]] && n=1 && missing="${missing}${v} ";
202     done
203     else
204     for v in CKV OKV KV_{MAJOR,PATCH} ; do
205     [[ -z ${!v} ]] && n=1 && missing="${missing}${v} ";
206     done
207     fi
208    
209 robbat2 1.234 [[ $n -eq 1 ]] && \
210     eerror "Missing variables: ${missing}" && \
211 ulm 1.249 die "Failed to extract kernel version (try explicit CKV in ebuild)!"
212 robbat2 1.234 unset v n missing
213 johnm 1.117
214 mpagano 1.254 # if [[ ${KV_MAJOR} -ge 3 ]]; then
215     if [[ ${#OKV_ARRAY[@]} -lt 3 ]]; then
216 mpagano 1.252 KV_PATCH_ARR=(${KV_PATCH//\./ })
217 mpagano 1.254
218     # at this point 080811, Linus is putting 3.1 kernels in 3.0 directory
219 vapier 1.260 # revisit when 3.1 is released
220 mpagano 1.254 if [[ ${KV_PATCH} -gt 0 ]]; then
221     KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))"
222     else
223     KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_PATCH_ARR}"
224     fi
225     # KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_PATCH_ARR}"
226 mpagano 1.252 [[ -n "${K_LONGTERM}" ]] &&
227     KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_PATCH_ARR}"
228     else
229 mpagano 1.257 #KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.0"
230 mpagano 1.261 #KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}"
231 mpagano 1.262 if [[ ${KV_MAJOR} -ge 3 ]]; then
232     KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.x"
233     else
234     KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}"
235     fi
236    
237 mpagano 1.252 [[ -n "${K_LONGTERM}" ]] &&
238 mpagano 1.262 KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm"
239     #KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
240 mpagano 1.252 fi
241 mpagano 1.244
242 mpagano 1.257 debug-print "KERNEL_BASE_URI is ${KERNEL_BASE_URI}"
243    
244 mpagano 1.254 if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
245 mpagano 1.259 # handle non genpatch using sources correctly
246     if [[ -z ${K_WANT_GENPATCHES} && -z ${K_GENPATCHES_VER} && ${KV_PATCH} -gt 0 ]]; then
247 mpagano 1.254 KERNEL_URI="${KERNEL_BASE_URI}/patch-${OKV}.bz2"
248     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV}.bz2"
249     fi
250     KERNEL_URI="${KERNEL_URI} ${KERNEL_BASE_URI}/linux-${KV_MAJOR}.${KV_MINOR}.tar.bz2"
251     else
252     KERNEL_URI="${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
253     fi
254 johnm 1.117
255     RELEASE=${CKV/${OKV}}
256     RELEASE=${RELEASE/_beta}
257     RELEASE=${RELEASE/_rc/-rc}
258     RELEASE=${RELEASE/_pre/-pre}
259 robbat2 1.234 # We cannot trivally call kernel_is here, because it calls us to detect the
260     # version
261     #kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git}
262 mpagano 1.252 [ $(($KV_MAJOR * 1000 + ${KV_MINOR:-0})) -ge 2006 ] && RELEASE=${RELEASE/-pre/-git}
263 johnm 1.117 RELEASETYPE=${RELEASE//[0-9]}
264    
265 gregkh 1.156 # Now we know that RELEASE is the -rc/-git
266 johnm 1.117 # and RELEASETYPE is the same but with its numerics stripped
267     # we can work on better sorting EXTRAVERSION.
268     # first of all, we add the release
269     EXTRAVERSION="${RELEASE}"
270 robbat2 1.163 debug-print "0 EXTRAVERSION:${EXTRAVERSION}"
271 mpagano 1.254 [[ -n ${KV_EXTRA} ]] && [[ ${KV_MAJOR} -lt 3 ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}"
272 johnm 1.117
273 robbat2 1.163 debug-print "1 EXTRAVERSION:${EXTRAVERSION}"
274     if [[ -n "${K_NOUSEPR}" ]]; then
275     # Don't add anything based on PR to EXTRAVERSION
276     debug-print "1.0 EXTRAVERSION:${EXTRAVERSION}"
277     elif [[ -n ${K_PREPATCHED} ]]; then
278     debug-print "1.1 EXTRAVERSION:${EXTRAVERSION}"
279 johnm 1.117 EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}"
280     elif [[ "${ETYPE}" = "sources" ]]; then
281 robbat2 1.163 debug-print "1.2 EXTRAVERSION:${EXTRAVERSION}"
282 johnm 1.117 # For some sources we want to use the PV in the extra version
283     # This is because upstream releases with a completely different
284     # versioning scheme.
285     case ${PN/-*} in
286     wolk) K_USEPV=1;;
287     vserver) K_USEPV=1;;
288     esac
289    
290 robbat2 1.163 [[ -z "${K_NOUSENAME}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}"
291     [[ -n "${K_USEPV}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}"
292     [[ -n "${PR//r0}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
293 johnm 1.117 fi
294 robbat2 1.163 debug-print "2 EXTRAVERSION:${EXTRAVERSION}"
295 johnm 1.117
296 johnm 1.120 # The only messing around which should actually effect this is for KV_EXTRA
297     # since this has to limit OKV to MAJ.MIN.PAT and strip EXTRA off else
298     # KV_FULL evaluates to MAJ.MIN.PAT.EXT.EXT after EXTRAVERSION
299 mpagano 1.252
300 johnm 1.120 if [[ -n ${KV_EXTRA} ]]; then
301 mpagano 1.252 if [[ -n ${KV_MINOR} ]]; then
302     OKV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
303     else
304     OKV="${KV_MAJOR}.${KV_PATCH}"
305     fi
306 ulm 1.249 KERNEL_URI="${KERNEL_BASE_URI}/patch-${CKV}.bz2
307 mpagano 1.244 ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
308 johnm 1.120 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV}.bz2"
309     fi
310 swegener 1.135
311 johnm 1.118 # We need to set this using OKV, but we need to set it before we do any
312     # messing around with OKV based on RELEASETYPE
313     KV_FULL=${OKV}${EXTRAVERSION}
314    
315     # we will set this for backwards compatibility.
316     S=${WORKDIR}/linux-${KV_FULL}
317     KV=${KV_FULL}
318    
319 gregkh 1.156 # -rc-git pulls can be achieved by specifying CKV
320 johnm 1.117 # for example:
321     # CKV="2.6.11_rc3_pre2"
322     # will pull:
323 gregkh 1.156 # linux-2.6.10.tar.bz2 & patch-2.6.11-rc3.bz2 & patch-2.6.11-rc3-git2.bz2
324 johnm 1.117
325 mpagano 1.252 if [[ ${KV_MAJOR}${KV_MINOR} -eq 26 ]]; then
326    
327     if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
328     OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
329     KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.bz2
330     ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
331     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.bz2"
332     fi
333    
334     if [[ ${RELEASETYPE} == -git ]]; then
335     KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${OKV}${RELEASE}.bz2
336     ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
337     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.bz2"
338     fi
339    
340     if [[ ${RELEASETYPE} == -rc-git ]]; then
341     OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
342     KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2
343     ${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2
344     ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
345    
346     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
347     fi
348     else
349     if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
350     if [[ ${KV_MAJOR}${KV_PATCH} -eq 30 ]]; then
351     OKV="2.6.39"
352     else
353     KV_PATCH_ARR=(${KV_PATCH//\./ })
354     OKV="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))"
355     fi
356     KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.bz2
357     ${KERNEL_BASE_URI}/testing/linux-${OKV}.tar.bz2"
358     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.bz2"
359     fi
360    
361     if [[ ${RELEASETYPE} == -git ]]; then
362     KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${OKV}${RELEASE}.bz2
363     ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
364     UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.bz2"
365     fi
366    
367     if [[ ${RELEASETYPE} == -rc-git ]]; then
368     if [[ ${KV_MAJOR}${KV_PATCH} -eq 30 ]]; then
369     OKV="2.6.39"
370     else
371     KV_PATCH_ARR=(${KV_PATCH//\./ })
372     OKV="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))"
373     fi
374     KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.bz2
375     ${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.bz2
376     ${KERNEL_BASE_URI}/linux-${OKV}.tar.bz2"
377 johnm 1.117
378 mpagano 1.252 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.bz2"
379     fi
380 johnm 1.117
381 mpagano 1.244
382 johnm 1.117 fi
383 dsd 1.126
384 mpagano 1.252
385 swegener 1.165 debug-print-kernel2-variables
386 robbat2 1.163
387 dsd 1.126 handle_genpatches
388 johnm 1.117 }
389    
390 plasmaroo 1.33 kernel_is() {
391 robbat2 1.226 # ALL of these should be set before we can safely continue this function.
392     # some of the sources have in the past had only one set.
393     local v n=0
394     for v in OKV KV_{MAJOR,MINOR,PATCH} ; do [[ -z ${!v} ]] && n=1 ; done
395     [[ $n -eq 1 ]] && detect_version
396     unset v n
397    
398     # Now we can continue
399 johnm 1.93 local operator test value x=0 y=0 z=0
400 johnm 1.67
401 johnm 1.93 case ${1} in
402     lt) operator="-lt"; shift;;
403     gt) operator="-gt"; shift;;
404     le) operator="-le"; shift;;
405     ge) operator="-ge"; shift;;
406     eq) operator="-eq"; shift;;
407     *) operator="-eq";;
408     esac
409    
410     for x in ${@}; do
411     for((y=0; y<$((3 - ${#x})); y++)); do value="${value}0"; done
412     value="${value}${x}"
413     z=$((${z} + 1))
414 swegener 1.135
415 johnm 1.93 case ${z} in
416     1) for((y=0; y<$((3 - ${#KV_MAJOR})); y++)); do test="${test}0"; done;
417     test="${test}${KV_MAJOR}";;
418     2) for((y=0; y<$((3 - ${#KV_MINOR})); y++)); do test="${test}0"; done;
419     test="${test}${KV_MINOR}";;
420     3) for((y=0; y<$((3 - ${#KV_PATCH})); y++)); do test="${test}0"; done;
421     test="${test}${KV_PATCH}";;
422     *) die "Error in kernel-2_kernel_is(): Too many parameters.";;
423     esac
424     done
425 johnm 1.69
426 johnm 1.93 [ ${test} ${operator} ${value} ] && return 0 || return 1
427 plasmaroo 1.33 }
428 johnm 1.18
429     kernel_is_2_4() {
430 johnm 1.56 kernel_is 2 4
431 johnm 1.18 }
432    
433     kernel_is_2_6() {
434 johnm 1.78 kernel_is 2 6 || kernel_is 2 5
435 johnm 1.18 }
436    
437 plasmaroo 1.33 # Capture the sources type and set DEPENDs
438 hollow 1.95 if [[ ${ETYPE} == sources ]]; then
439 johnm 1.1 DEPEND="!build? ( sys-apps/sed
440 dsd 1.183 >=sys-devel/binutils-2.11.90.0.31 )"
441 johnm 1.147 RDEPEND="!build? ( >=sys-libs/ncurses-5.2
442 ulm 1.249 sys-devel/make )"
443 robbat2 1.222 PDEPEND="!build? ( virtual/dev-manager )"
444 lu_zero 1.62
445 johnm 1.72 SLOT="${PVR}"
446 mpagano 1.252 DESCRIPTION="Sources for the ${KV_MAJOR}.${KV_MINOR:-$KV_PATCH} linux kernel"
447 dsd 1.183 IUSE="symlink build"
448 robbat2 1.229
449     # Bug #266157, deblob for libre support
450 robbat2 1.230 if [[ -z ${K_PREDEBLOBBED} ]] ; then
451 mpagano 1.250 # Bug #359865, force a call to detect_version if needed
452     kernel_is ge 2 6 27 && \
453     [[ -z "${K_DEBLOB_AVAILABLE}" ]] && \
454 robbat2 1.231 kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \
455 mpagano 1.250 K_DEBLOB_AVAILABLE=1
456 robbat2 1.231 if [[ ${K_DEBLOB_AVAILABLE} == "1" ]] ; then
457 robbat2 1.229 IUSE="${IUSE} deblob"
458     # Reflect that kernels contain firmware blobs unless otherwise
459     # stripped
460     LICENSE="${LICENSE} !deblob? ( freedist )"
461    
462 mpagano 1.252 if [[ -n KV_MINOR ]]; then
463     DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
464     else
465     DEBLOB_PV="${KV_MAJOR}.${KV_PATCH}"
466     fi
467    
468 mpagano 1.255 if [[ ${KV_MAJOR} -ge 3 ]]; then
469     DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}"
470     fi
471    
472 robbat2 1.229 DEBLOB_A="deblob-${DEBLOB_PV}"
473 robbat2 1.239 DEBLOB_CHECK_A="deblob-check-${DEBLOB_PV}"
474 robbat2 1.229 DEBLOB_HOMEPAGE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
475 robbat2 1.239 DEBLOB_URI_PATH="download/releases/LATEST-${DEBLOB_PV}.N"
476     if ! has "${EAPI:-0}" 0 1 ; then
477     DEBLOB_CHECK_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/deblob-check -> ${DEBLOB_CHECK_A}"
478     else
479     DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
480     fi
481     DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}"
482 robbat2 1.229 HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
483 ulm 1.249
484 robbat2 1.229 KERNEL_URI="${KERNEL_URI}
485     deblob? (
486 robbat2 1.239 ${DEBLOB_URI}
487     ${DEBLOB_CHECK_URI}
488 robbat2 1.229 )"
489     else
490     # We have no way to deblob older kernels, so just mark them as
491     # tainted with non-libre materials.
492     LICENSE="${LICENSE} freedist"
493     fi
494     fi
495    
496 hollow 1.95 elif [[ ${ETYPE} == headers ]]; then
497 johnm 1.72 DESCRIPTION="Linux system headers"
498 swegener 1.135
499 johnm 1.174 # Since we should NOT honour KBUILD_OUTPUT in headers
500     # lets unset it here.
501     unset KBUILD_OUTPUT
502    
503 vapier 1.265 SLOT="0"
504 johnm 1.1 else
505 johnm 1.55 eerror "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
506 johnm 1.93 die "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
507 johnm 1.1 fi
508    
509 vapier 1.153 # Cross-compile support functions
510 johnm 1.1 #==============================================================
511 vapier 1.153 kernel_header_destdir() {
512     [[ ${CTARGET} == ${CHOST} ]] \
513     && echo /usr/include \
514 vapier 1.168 || echo /usr/${CTARGET}/usr/include
515 vapier 1.153 }
516    
517     cross_pre_c_headers() {
518 kugelfang 1.187 use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
519 vapier 1.153 }
520    
521     env_setup_xmakeopts() {
522 johnm 1.117 # Kernel ARCH != portage ARCH
523 vapier 1.153 export KARCH=$(tc-arch-kernel)
524 johnm 1.117
525 vapier 1.136 # When cross-compiling, we need to set the ARCH/CROSS_COMPILE
526     # variables properly or bad things happen !
527 vapier 1.153 xmakeopts="ARCH=${KARCH}"
528     if [[ ${CTARGET} != ${CHOST} ]] && ! cross_pre_c_headers ; then
529 vapier 1.136 xmakeopts="${xmakeopts} CROSS_COMPILE=${CTARGET}-"
530 vapier 1.151 elif type -p ${CHOST}-ar > /dev/null ; then
531 vapier 1.136 xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
532     fi
533 vapier 1.153 export xmakeopts
534     }
535    
536     # Unpack functions
537     #==============================================================
538     unpack_2_4() {
539 lu_zero 1.62 # this file is required for other things to build properly,
540 johnm 1.1 # so we autogenerate it
541 vapier 1.145 make -s mrproper ${xmakeopts} || die "make mrproper failed"
542     make -s symlinks ${xmakeopts} || die "make symlinks failed"
543     make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed"
544 johnm 1.1 echo ">>> version.h compiled successfully."
545     }
546    
547 vapier 1.153 unpack_2_6() {
548     # this file is required for other things to build properly, so we
549 johnm 1.172 # autogenerate it ... generate a .config to keep version.h build from
550 vapier 1.153 # spitting out an annoying warning
551 johnm 1.177 make -s mrproper ${xmakeopts} 2>/dev/null \
552     || die "make mrproper failed"
553    
554     # quick fix for bug #132152 which triggers when it cannot include linux
555     # headers (ie, we have not installed it yet)
556 vapier 1.188 if ! make -s defconfig ${xmakeopts} &>/dev/null 2>&1 ; then
557 johnm 1.177 touch .config
558     eerror "make defconfig failed."
559     eerror "assuming you dont have any headers installed yet and continuing"
560     epause 5
561     fi
562    
563     make -s include/linux/version.h ${xmakeopts} 2>/dev/null \
564     || die "make include/linux/version.h failed"
565 swegener 1.179 rm -f .config >/dev/null
566 vapier 1.153 }
567    
568 johnm 1.1 universal_unpack() {
569 mpagano 1.254 debug-print "Inside universal_unpack"
570    
571 vapier 1.266 local OKV_ARRAY
572     IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
573 mpagano 1.254
574 mpagano 1.223 cd "${WORKDIR}"
575 mpagano 1.254 if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
576     unpack linux-${KV_MAJOR}.${KV_MINOR}.tar.bz2
577     else
578     unpack linux-${OKV}.tar.bz2
579     fi
580    
581 johnm 1.175 if [[ -d "linux" ]]; then
582 mpagano 1.254 debug-print "Moving linux to linux-${KV_FULL}"
583 johnm 1.175 mv linux linux-${KV_FULL} \
584     || die "Unable to move source tree to ${KV_FULL}."
585     elif [[ "${OKV}" != "${KV_FULL}" ]]; then
586 mpagano 1.254 if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]] &&
587     [[ "${ETYPE}" = "sources" ]]; then
588     debug-print "moving linux-${KV_MAJOR}.${KV_MINOR} to linux-${KV_FULL} "
589     mv linux-${KV_MAJOR}.${KV_MINOR} linux-${KV_FULL} \
590     || die "Unable to move source tree to ${KV_FULL}."
591     else
592     debug-print "moving linux-${OKV} to linux-${KV_FULL} "
593     mv linux-${OKV} linux-${KV_FULL} \
594     || die "Unable to move source tree to ${KV_FULL}."
595     fi
596     elif [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
597     mv linux-${KV_MAJOR}.${KV_MINOR} linux-${KV_FULL} \
598 johnm 1.55 || die "Unable to move source tree to ${KV_FULL}."
599 hollow 1.98 fi
600 vapier 1.136 cd "${S}"
601 lu_zero 1.62
602 johnm 1.1 # remove all backup files
603     find . -iname "*~" -exec rm {} \; 2> /dev/null
604    
605 johnm 1.78 # fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox
606 mpagano 1.215 # only do this for kernel < 2.6.27 since this file does not exist in later
607     # kernels
608 mpagano 1.252 if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]]
609 mpagano 1.215 then
610     sed -i \
611     -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \
612     "${S}"/arch/ppc/Makefile
613 mpagano 1.216 else
614     sed -i \
615     -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \
616     "${S}"/arch/powerpc/Makefile
617 mpagano 1.215 fi
618 johnm 1.1 }
619    
620     unpack_set_extraversion() {
621 vapier 1.136 cd "${S}"
622 dsd 1.104 sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile
623 vapier 1.185 cd "${OLDPWD}"
624 johnm 1.1 }
625    
626 dsd 1.104 # Should be done after patches have been applied
627     # Otherwise patches that modify the same area of Makefile will fail
628     unpack_fix_install_path() {
629 vapier 1.136 cd "${S}"
630 dsd 1.104 sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile
631     }
632    
633 johnm 1.1 # Compile Functions
634     #==============================================================
635     compile_headers() {
636 vapier 1.153 env_setup_xmakeopts
637    
638 swegener 1.135 # if we couldnt obtain HOSTCFLAGS from the Makefile,
639 vapier 1.75 # then set it to something sane
640 vapier 1.136 local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile)
641 vapier 1.75 HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer}
642    
643 johnm 1.93 if kernel_is 2 4; then
644 vapier 1.75 yes "" | make oldconfig ${xmakeopts}
645 johnm 1.72 echo ">>> make oldconfig complete"
646 vapier 1.152 make dep ${xmakeopts}
647 hollow 1.95 elif kernel_is 2 6; then
648 vapier 1.193 # 2.6.18 introduces headers_install which means we dont need any
649     # of this crap anymore :D
650     kernel_is ge 2 6 18 && return 0
651    
652 johnm 1.72 # autoconf.h isnt generated unless it already exists. plus, we have
653     # no guarantee that any headers are installed on the system...
654 vapier 1.75 [[ -f ${ROOT}/usr/include/linux/autoconf.h ]] \
655 johnm 1.72 || touch include/linux/autoconf.h
656    
657 plasmaroo 1.105 # if K_DEFCONFIG isn't set, force to "defconfig"
658     # needed by mips
659     if [[ -z ${K_DEFCONFIG} ]]; then
660 dostrow 1.194 if [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]]; then
661     case ${CTARGET} in
662     powerpc64*) K_DEFCONFIG="ppc64_defconfig";;
663     powerpc*) K_DEFCONFIG="pmac32_defconfig";;
664     *) K_DEFCONFIG="defconfig";;
665     esac
666     else
667     K_DEFCONFIG="defconfig"
668     fi
669 plasmaroo 1.105 fi
670    
671 johnm 1.72 # if there arent any installed headers, then there also isnt an asm
672     # symlink in /usr/include/, and make defconfig will fail, so we have
673     # to force an include path with $S.
674 vapier 1.75 HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
675     ln -sf asm-${KARCH} "${S}"/include/asm
676 vapier 1.153 cross_pre_c_headers && return 0
677    
678 vapier 1.170 make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})"
679     if compile_headers_tweak_config ; then
680     yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed"
681     fi
682 vapier 1.75 make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
683 eradicator 1.100 make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
684 johnm 1.72 fi
685 johnm 1.1 }
686    
687 vapier 1.170 compile_headers_tweak_config() {
688     # some targets can be very very picky, so let's finesse the
689     # .config based upon any info we may have
690     case ${CTARGET} in
691     sh*)
692     sed -i '/CONFIG_CPU_SH/d' .config
693     echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config
694     return 0;;
695     esac
696    
697     # no changes, so lets do nothing
698     return 1
699     }
700    
701 johnm 1.1 # install functions
702     #==============================================================
703     install_universal() {
704     #fix silly permissions in tarball
705 mpagano 1.223 cd "${WORKDIR}"
706 vapier 1.217 chown -R root:0 * >& /dev/null
707 johnm 1.1 chmod -R a+r-w+X,u+w *
708 johnm 1.93 cd ${OLDPWD}
709 johnm 1.1 }
710    
711     install_headers() {
712 vapier 1.195 local ddir=$(kernel_header_destdir)
713    
714 vapier 1.193 # 2.6.18 introduces headers_install which means we dont need any
715     # of this crap anymore :D
716     if kernel_is ge 2 6 18 ; then
717     env_setup_xmakeopts
718 vapier 1.195 emake headers_install INSTALL_HDR_PATH="${D}"/${ddir}/.. ${xmakeopts} || die
719 vapier 1.196
720     # let other packages install some of these headers
721     rm -rf "${D}"/${ddir}/sound #alsa-headers
722     rm -rf "${D}"/${ddir}/scsi #glibc/uclibc/etc...
723 vapier 1.193 return 0
724     fi
725    
726 vapier 1.198 # Do not use "linux/*" as that can cause problems with very long
727     # $S values where the cmdline to cp is too long
728 vapier 1.245 pushd "${S}" >/dev/null
729 vapier 1.60 dodir ${ddir}/linux
730 vapier 1.198 cp -pPR "${S}"/include/linux "${D}"/${ddir}/ || die
731     rm -rf "${D}"/${ddir}/linux/modules
732 lu_zero 1.62
733 vapier 1.245 dodir ${ddir}/asm
734     cp -pPR "${S}"/include/asm/* "${D}"/${ddir}/asm
735 vapier 1.137
736 vapier 1.245 if kernel_is 2 6 ; then
737 vapier 1.60 dodir ${ddir}/asm-generic
738 mpagano 1.223 cp -pPR "${S}"/include/asm-generic/* "${D}"/${ddir}/asm-generic
739 johnm 1.12 fi
740 eradicator 1.99
741 vapier 1.103 # clean up
742     find "${D}" -name '*.orig' -exec rm -f {} \;
743    
744 vapier 1.245 popd >/dev/null
745 johnm 1.1 }
746    
747     install_sources() {
748 dsd 1.183 local file
749 johnm 1.1
750 vapier 1.136 cd "${S}"
751 johnm 1.12 dodir /usr/src
752 johnm 1.54 echo ">>> Copying sources ..."
753 johnm 1.93
754 johnm 1.27 file="$(find ${WORKDIR} -iname "docs" -type d)"
755 johnm 1.93 if [[ -n ${file} ]]; then
756     for file in $(find ${file} -type f); do
757 vapier 1.136 echo "${file//*docs\/}" >> "${S}"/patches.txt
758     echo "===================================================" >> "${S}"/patches.txt
759     cat ${file} >> "${S}"/patches.txt
760     echo "===================================================" >> "${S}"/patches.txt
761     echo "" >> "${S}"/patches.txt
762 johnm 1.1 done
763 johnm 1.12 fi
764 johnm 1.1
765 johnm 1.93 if [[ ! -f ${S}/patches.txt ]]; then
766 johnm 1.12 # patches.txt is empty so lets use our ChangeLog
767 johnm 1.93 [[ -f ${FILESDIR}/../ChangeLog ]] && \
768     echo "Please check the ebuild ChangeLog for more details." \
769 vapier 1.136 > "${S}"/patches.txt
770 johnm 1.12 fi
771    
772 mpagano 1.223 mv ${WORKDIR}/linux* "${D}"/usr/src
773 johnm 1.1 }
774    
775     # pkg_preinst functions
776     #==============================================================
777     preinst_headers() {
778 vapier 1.60 local ddir=$(kernel_header_destdir)
779 johnm 1.72 [[ -L ${ddir}/linux ]] && rm ${ddir}/linux
780     [[ -L ${ddir}/asm ]] && rm ${ddir}/asm
781 johnm 1.1 }
782    
783     # pkg_postinst functions
784     #==============================================================
785     postinst_sources() {
786 vapier 1.80 local MAKELINK=0
787 swegener 1.135
788 johnm 1.84 # if we have USE=symlink, then force K_SYMLINK=1
789     use symlink && K_SYMLINK=1
790    
791 robbat2 1.229 # if we're using a deblobbed kernel, it's not supported
792 robbat2 1.230 [[ $K_DEBLOB_AVAILABLE == 1 ]] && \
793 robbat2 1.229 use deblob && \
794 robbat2 1.232 K_SECURITY_UNSUPPORTED=deblob
795 robbat2 1.229
796 johnm 1.78 # if we are to forcably symlink, delete it if it already exists first.
797 johnm 1.166 if [[ ${K_SYMLINK} > 0 ]]; then
798 vapier 1.80 [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux
799 johnm 1.78 MAKELINK=1
800     fi
801 swegener 1.135
802 johnm 1.78 # if the link doesnt exist, lets create it
803 vapier 1.80 [[ ! -h ${ROOT}usr/src/linux ]] && MAKELINK=1
804 swegener 1.135
805 johnm 1.93 if [[ ${MAKELINK} == 1 ]]; then
806 mpagano 1.223 cd "${ROOT}"usr/src
807 johnm 1.89 ln -sf linux-${KV_FULL} linux
808     cd ${OLDPWD}
809     fi
810 johnm 1.1
811     # Don't forget to make directory for sysfs
812 johnm 1.111 [[ ! -d ${ROOT}sys ]] && kernel_is 2 6 && mkdir ${ROOT}sys
813 johnm 1.1
814     echo
815 zlin 1.208 elog "If you are upgrading from a previous kernel, you may be interested"
816 mpagano 1.213 elog "in the following document:"
817 zlin 1.208 elog " - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml"
818 r3pek 1.113 echo
819 lu_zero 1.62
820 johnm 1.2 # if K_EXTRAEINFO is set then lets display it now
821 hollow 1.95 if [[ -n ${K_EXTRAEINFO} ]]; then
822 johnm 1.2 echo ${K_EXTRAEINFO} | fmt |
823 hollow 1.95 while read -s ELINE; do einfo "${ELINE}"; done
824 plasmaroo 1.33 fi
825    
826 zlin 1.208 # if K_EXTRAELOG is set then lets display it now
827     if [[ -n ${K_EXTRAELOG} ]]; then
828     echo ${K_EXTRAELOG} | fmt |
829     while read -s ELINE; do elog "${ELINE}"; done
830     fi
831    
832 iggy 1.7 # if K_EXTRAEWARN is set then lets display it now
833 hollow 1.95 if [[ -n ${K_EXTRAEWARN} ]]; then
834 iggy 1.7 echo ${K_EXTRAEWARN} | fmt |
835 hollow 1.95 while read -s ELINE; do ewarn "${ELINE}"; done
836 iggy 1.7 fi
837 dsd 1.200
838     # optionally display security unsupported message
839 robbat2 1.232 # Start with why
840     if [[ ${K_SECURITY_UNSUPPORTED} = deblob ]]; then
841 ulm 1.233 ewarn "Deblobbed kernels are UNSUPPORTED by Gentoo Security."
842 robbat2 1.232 elif [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
843     ewarn "${PN} is UNSUPPORTED by Gentoo Security."
844     fi
845     # And now the general message.
846 dsd 1.200 if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
847     ewarn "This means that it is likely to be vulnerable to recent security issues."
848     ewarn "For specific information on why this kernel is unsupported, please read:"
849     ewarn "http://www.gentoo.org/proj/en/security/kernel.xml"
850     fi
851 bluebird 1.214
852     # warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765)
853     KV_MAJOR=$(get_version_component_range 1 ${OKV})
854     KV_MINOR=$(get_version_component_range 2 ${OKV})
855     KV_PATCH=$(get_version_component_range 3 ${OKV})
856 mpagano 1.252 if [[ "$(tc-arch)" = "sparc" ]]; then
857     if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]]
858     then
859     echo
860     elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that"
861     elog "you now need to do"
862     elog " make CROSS_COMPILE=sparc64-unknown-linux-gnu-"
863     elog "instead of just"
864     elog " make"
865     elog "to compile the kernel. For more information please browse to"
866     elog "https://bugs.gentoo.org/show_bug.cgi?id=214765"
867     echo
868     fi
869 bluebird 1.214 fi
870 johnm 1.1 }
871    
872 johnm 1.12 # pkg_setup functions
873     #==============================================================
874     setup_headers() {
875 vapier 1.86 [[ -z ${H_SUPPORTEDARCH} ]] && H_SUPPORTEDARCH=${PN/-*/}
876 hollow 1.95 for i in ${H_SUPPORTEDARCH}; do
877 vapier 1.87 [[ $(tc-arch) == "${i}" ]] && H_ACCEPT_ARCH="yes"
878 johnm 1.12 done
879 lu_zero 1.62
880 johnm 1.93 if [[ ${H_ACCEPT_ARCH} != "yes" ]]; then
881 johnm 1.12 echo
882 vapier 1.106 eerror "This version of ${PN} does not support $(tc-arch)."
883 johnm 1.12 eerror "Please merge the appropriate sources, in most cases"
884 vapier 1.106 eerror "(but not all) this will be called $(tc-arch)-headers."
885     die "Package unsupported for $(tc-arch)"
886 johnm 1.12 fi
887     }
888    
889 johnm 1.1 # unipatch
890     #==============================================================
891     unipatch() {
892 johnm 1.108 local i x y z extention PIPE_CMD UNIPATCH_DROP KPATCH_DIR PATCH_DEPTH ELINE
893 mpagano 1.238 local STRICT_COUNT PATCH_LEVEL myLC_ALL myLANG
894 swegener 1.135
895 johnm 1.78 # set to a standard locale to ensure sorts are ordered properly.
896     myLC_ALL="${LC_ALL}"
897 johnm 1.122 myLANG="${LANG}"
898 johnm 1.78 LC_ALL="C"
899 johnm 1.122 LANG=""
900 johnm 1.1
901     [ -z "${KPATCH_DIR}" ] && KPATCH_DIR="${WORKDIR}/patches/"
902     [ ! -d ${KPATCH_DIR} ] && mkdir -p ${KPATCH_DIR}
903    
904 johnm 1.41 # We're gonna need it when doing patches with a predefined patchlevel
905 mpagano 1.238 eshopts_push -s extglob
906 johnm 1.41
907 johnm 1.54 # This function will unpack all passed tarballs, add any passed patches, and remove any passed patchnumbers
908 johnm 1.1 # usage can be either via an env var or by params
909 johnm 1.54 # although due to the nature we pass this within this eclass
910     # it shall be by param only.
911     # -z "${UNIPATCH_LIST}" ] && UNIPATCH_LIST="${@}"
912     UNIPATCH_LIST="${@}"
913 johnm 1.1
914     #unpack any passed tarballs
915 hollow 1.95 for i in ${UNIPATCH_LIST}; do
916 vapier 1.210 if echo ${i} | grep -qs -e "\.tar" -e "\.tbz" -e "\.tgz" ; then
917 hollow 1.95 if [ -n "${UNIPATCH_STRICTORDER}" ]; then
918 johnm 1.110 unset z
919 johnm 1.121 STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
920 johnm 1.108 for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
921     do z="${z}0";
922     done
923 r3pek 1.112 PATCH_ORDER="${z}${STRICT_COUNT}"
924 johnm 1.108
925 vapier 1.210 mkdir -p "${KPATCH_DIR}/${PATCH_ORDER}"
926     pushd "${KPATCH_DIR}/${PATCH_ORDER}" >/dev/null
927     unpack ${i##*/}
928     popd >/dev/null
929 johnm 1.16 else
930 vapier 1.210 pushd "${KPATCH_DIR}" >/dev/null
931     unpack ${i##*/}
932     popd >/dev/null
933 johnm 1.16 fi
934    
935 vapier 1.210 [[ ${i} == *:* ]] && echo ">>> Strict patch levels not currently supported for tarballed patchsets"
936 johnm 1.16 else
937 johnm 1.25 extention=${i/*./}
938 johnm 1.41 extention=${extention/:*/}
939 johnm 1.25 PIPE_CMD=""
940     case ${extention} in
941 vapier 1.236 xz) PIPE_CMD="xz -dc";;
942     lzma) PIPE_CMD="lzma -dc";;
943 johnm 1.25 bz2) PIPE_CMD="bzip2 -dc";;
944     patch) PIPE_CMD="cat";;
945     diff) PIPE_CMD="cat";;
946     gz|Z|z) PIPE_CMD="gzip -dc";;
947     ZIP|zip) PIPE_CMD="unzip -p";;
948 johnm 1.41 *) UNIPATCH_DROP="${UNIPATCH_DROP} ${i/:*/}";;
949 johnm 1.25 esac
950 johnm 1.41
951     PATCH_LEVEL=${i/*([^:])?(:)}
952     i=${i/:*/}
953 johnm 1.25 x=${i/*\//}
954     x=${x/\.${extention}/}
955 lu_zero 1.62
956 hollow 1.95 if [ -n "${PIPE_CMD}" ]; then
957     if [ ! -r "${i}" ]; then
958 johnm 1.29 echo
959     eerror "FATAL: unable to locate:"
960     eerror "${i}"
961 johnm 1.54 eerror "for read-only. The file either has incorrect permissions"
962     eerror "or does not exist."
963 johnm 1.29 die Unable to locate ${i}
964     fi
965 lu_zero 1.62
966 hollow 1.95 if [ -n "${UNIPATCH_STRICTORDER}" ]; then
967 johnm 1.110 unset z
968 johnm 1.121 STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
969 johnm 1.108 for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
970     do z="${z}0";
971     done
972 r3pek 1.112 PATCH_ORDER="${z}${STRICT_COUNT}"
973 johnm 1.108
974 r3pek 1.112 mkdir -p ${KPATCH_DIR}/${PATCH_ORDER}/
975 scarabeus 1.241 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
976 johnm 1.29 else
977 scarabeus 1.241 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
978 johnm 1.29 fi
979 johnm 1.25 fi
980 johnm 1.16 fi
981 johnm 1.1 done
982    
983     #populate KPATCH_DIRS so we know where to look to remove the excludes
984     x=${KPATCH_DIR}
985     KPATCH_DIR=""
986 hollow 1.95 for i in $(find ${x} -type d | sort -n); do
987 johnm 1.1 KPATCH_DIR="${KPATCH_DIR} ${i}"
988     done
989    
990 mpagano 1.219 # do not apply fbcondecor patch to sparc/sparc64 as it breaks boot
991     # bug #272676
992 maekke 1.220 if [[ "$(tc-arch)" = "sparc" || "$(tc-arch)" = "sparc64" ]]; then
993 mpagano 1.252 if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then
994 mpagano 1.219 UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor-0.9.6.patch"
995     echo
996     ewarn "fbcondecor currently prevents sparc/sparc64 from booting"
997     ewarn "for kernel versions >= 2.6.29. Removing fbcondecor patch."
998     ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=272676 for details"
999     echo
1000     fi
1001     fi
1002    
1003 johnm 1.1 #so now lets get rid of the patchno's we want to exclude
1004 johnm 1.19 UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
1005 hollow 1.95 for i in ${UNIPATCH_DROP}; do
1006 johnm 1.55 ebegin "Excluding Patch #${i}"
1007 hollow 1.95 for x in ${KPATCH_DIR}; do rm -f ${x}/${i}* 2>/dev/null; done
1008 johnm 1.55 eend $?
1009 johnm 1.1 done
1010    
1011     # and now, finally, we patch it :)
1012 hollow 1.95 for x in ${KPATCH_DIR}; do
1013     for i in $(find ${x} -maxdepth 1 -iname "*.patch*" -or -iname "*.diff*" | sort -n); do
1014 johnm 1.25 STDERR_T="${T}/${i/*\//}"
1015 johnm 1.41 STDERR_T="${STDERR_T/.patch*/.err}"
1016    
1017 lu_zero 1.62 [ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/}
1018 r3pek 1.112 #[ -z ${i/*.diff*/} ] && PATCH_DEPTH=${i/*.diff/}
1019 johnm 1.41
1020 hollow 1.96 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
1021 johnm 1.41
1022     ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)"
1023 hollow 1.95 while [ ${PATCH_DEPTH} -lt 5 ]; do
1024 plasmaroo 1.33 echo "Attempting Dry-run:" >> ${STDERR_T}
1025 robbat2 1.204 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T}
1026 johnm 1.54 echo "=======================================================" >> ${STDERR_T}
1027 robbat2 1.204 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then
1028 johnm 1.25 echo "Attempting patch:" > ${STDERR_T}
1029 robbat2 1.204 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T}
1030 johnm 1.54 echo "=======================================================" >> ${STDERR_T}
1031 robbat2 1.204 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then
1032 johnm 1.1 eend 0
1033 johnm 1.25 rm ${STDERR_T}
1034 johnm 1.1 break
1035     else
1036     eend 1
1037     eerror "Failed to apply patch ${i/*\//}"
1038 johnm 1.54 eerror "Please attach ${STDERR_T} to any bug you may post."
1039 mpagano 1.238 eshopts_pop
1040 johnm 1.1 die "Failed to apply ${i/*\//}"
1041     fi
1042     else
1043     PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
1044     fi
1045     done
1046 hollow 1.95 if [ ${PATCH_DEPTH} -eq 5 ]; then
1047 johnm 1.1 eend 1
1048 johnm 1.54 eerror "Please attach ${STDERR_T} to any bug you may post."
1049 mpagano 1.238 eshopts_pop
1050 johnm 1.1 die "Unable to dry-run patch."
1051     fi
1052     done
1053     done
1054 johnm 1.43
1055 johnm 1.144 # This is a quick, and kind of nasty hack to deal with UNIPATCH_DOCS which
1056     # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite,
1057     # which is why I'm not taking too much time over this.
1058     local tmp
1059     for i in ${UNIPATCH_DOCS}; do
1060     tmp="${tmp} ${i//*\/}"
1061 mpagano 1.223 cp -f ${i} "${T}"/
1062 johnm 1.144 done
1063     UNIPATCH_DOCS="${tmp}"
1064 swegener 1.146
1065 johnm 1.43 # clean up KPATCH_DIR's - fixes bug #53610
1066 hollow 1.95 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
1067 swegener 1.135
1068 johnm 1.78 LC_ALL="${myLC_ALL}"
1069 johnm 1.122 LANG="${myLANG}"
1070 mpagano 1.238 eshopts_pop
1071 johnm 1.1 }
1072    
1073 johnm 1.74 # getfilevar accepts 2 vars as follows:
1074     # getfilevar <VARIABLE> <CONFIGFILE>
1075     # pulled from linux-info
1076    
1077     getfilevar() {
1078 johnm 1.93 local workingdir basefname basedname xarch=$(tc-arch-kernel)
1079 johnm 1.74
1080 johnm 1.93 if [[ -z ${1} ]] && [[ ! -f ${2} ]]; then
1081 johnm 1.74 echo -e "\n"
1082     eerror "getfilevar requires 2 variables, with the second a valid file."
1083     eerror " getfilevar <VARIABLE> <CONFIGFILE>"
1084     else
1085     workingdir=${PWD}
1086     basefname=$(basename ${2})
1087     basedname=$(dirname ${2})
1088     unset ARCH
1089 swegener 1.135
1090 johnm 1.74 cd ${basedname}
1091     echo -e "include ${basefname}\ne:\n\t@echo \$(${1})" | \
1092 johnm 1.119 make ${BUILD_FIXES} -s -f - e 2>/dev/null
1093 johnm 1.74 cd ${workingdir}
1094 swegener 1.135
1095 johnm 1.74 ARCH=${xarch}
1096     fi
1097     }
1098    
1099 johnm 1.28 detect_arch() {
1100     # This function sets ARCH_URI and ARCH_PATCH
1101     # with the neccessary info for the arch sepecific compatibility
1102     # patchsets.
1103 lu_zero 1.62
1104 johnm 1.93 local ALL_ARCH LOOP_ARCH COMPAT_URI i
1105 plasmaroo 1.33
1106     # COMPAT_URI is the contents of ${ARCH}_URI
1107     # ARCH_URI is the URI for all the ${ARCH}_URI patches
1108     # ARCH_PATCH is ARCH_URI broken into files for UNIPATCH
1109    
1110     ARCH_URI=""
1111     ARCH_PATCH=""
1112 vapier 1.145 ALL_ARCH="ALPHA AMD64 ARM HPPA IA64 M68K MIPS PPC PPC64 S390 SH SPARC X86"
1113 johnm 1.31
1114 hollow 1.95 for LOOP_ARCH in ${ALL_ARCH}; do
1115 johnm 1.31 COMPAT_URI="${LOOP_ARCH}_URI"
1116     COMPAT_URI="${!COMPAT_URI}"
1117 lu_zero 1.62
1118 vapier 1.86 [[ -n ${COMPAT_URI} ]] && \
1119 johnm 1.55 ARCH_URI="${ARCH_URI} $(echo ${LOOP_ARCH} | tr '[:upper:]' '[:lower:]')? ( ${COMPAT_URI} )"
1120 lu_zero 1.62
1121 johnm 1.93 if [[ ${LOOP_ARCH} == "$(echo $(tc-arch-kernel) | tr '[:lower:]' '[:upper:]')" ]]; then
1122     for i in ${COMPAT_URI}; do
1123 plasmaroo 1.33 ARCH_PATCH="${ARCH_PATCH} ${DISTDIR}/${i/*\//}"
1124     done
1125     fi
1126 johnm 1.31 done
1127 johnm 1.28 }
1128    
1129 johnm 1.72 # sparc nastiness
1130     #==============================================================
1131     # This script generates the files in /usr/include/asm for sparc systems
1132     # during installation of sys-kernel/linux-headers.
1133     # Will no longer be needed when full 64 bit support is used on sparc64
1134     # systems.
1135     #
1136     # Shamefully ripped from Debian
1137     # ----------------------------------------------------------------------
1138    
1139     # Idea borrowed from RedHat's kernel package
1140    
1141 eradicator 1.76 # This is gonna get replaced by something in multilib.eclass soon...
1142     # --eradicator
1143 johnm 1.72 generate_sparc_asm() {
1144     local name
1145    
1146     cd $1 || die
1147     mkdir asm
1148    
1149     for h in `( ls asm-sparc; ls asm-sparc64 ) | grep '\.h$' | sort -u`; do
1150     name="$(echo $h | tr a-z. A-Z_)"
1151     # common header
1152     echo "/* All asm/ files are generated and point to the corresponding
1153     * file in asm-sparc or asm-sparc64.
1154     */
1155    
1156     #ifndef __SPARCSTUB__${name}__
1157     #define __SPARCSTUB__${name}__
1158     " > asm/${h}
1159    
1160     # common for sparc and sparc64
1161     if [ -f asm-sparc/$h -a -f asm-sparc64/$h ]; then
1162     echo "#ifdef __arch64__
1163     #include <asm-sparc64/$h>
1164     #else
1165     #include <asm-sparc/$h>
1166     #endif
1167     " >> asm/${h}
1168    
1169     # sparc only
1170     elif [ -f asm-sparc/$h ]; then
1171     echo "#ifndef __arch64__
1172     #include <asm-sparc/$h>
1173     #endif
1174     " >> asm/${h}
1175    
1176     # sparc64 only
1177     else
1178     echo "#ifdef __arch64__
1179     #include <asm-sparc64/$h>
1180     #endif
1181     " >> asm/${h}
1182     fi
1183    
1184     # common footer
1185     echo "#endif /* !__SPARCSTUB__${name}__ */" >> asm/${h}
1186     done
1187     return 0
1188     }
1189    
1190 johnm 1.89 headers___fix() {
1191 plasmaroo 1.88 # Voodoo to partially fix broken upstream headers.
1192 vapier 1.205 # note: do not put inline/asm/volatile together (breaks "inline asm volatile")
1193 johnm 1.72 sed -i \
1194 plasmaroo 1.186 -e '/^\#define.*_TYPES_H/{:loop n; bloop}' \
1195 plasmaroo 1.184 -e 's:\<\([us]\(8\|16\|32\|64\)\)\>:__\1:g' \
1196 vapier 1.205 -e "s/\([[:space:]]\)inline\([[:space:](]\)/\1__inline__\2/g" \
1197     -e "s/\([[:space:]]\)asm\([[:space:](]\)/\1__asm__\2/g" \
1198     -e "s/\([[:space:]]\)volatile\([[:space:](]\)/\1__volatile__\2/g" \
1199 johnm 1.72 "$@"
1200     }
1201 johnm 1.28
1202 johnm 1.1 # common functions
1203     #==============================================================
1204 plasmaroo 1.33 kernel-2_src_unpack() {
1205 johnm 1.1 universal_unpack
1206 robbat2 1.163 debug-print "Doing unipatch"
1207 lu_zero 1.62
1208 dsd 1.126 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
1209     unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
1210 swegener 1.165
1211 robbat2 1.163 debug-print "Doing premake"
1212 lu_zero 1.62
1213 vapier 1.157 # allow ebuilds to massage the source tree after patching but before
1214     # we run misc `make` functions below
1215 vapier 1.158 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
1216 swegener 1.165
1217 mpagano 1.224 debug-print "Doing epatch_user"
1218     epatch_user
1219    
1220 robbat2 1.163 debug-print "Doing unpack_set_extraversion"
1221 vapier 1.157
1222 johnm 1.107 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
1223 dsd 1.104 unpack_fix_install_path
1224    
1225 johnm 1.172 # Setup xmakeopts and cd into sourcetree.
1226     env_setup_xmakeopts
1227     cd "${S}"
1228    
1229     # We dont need a version.h for anything other than headers
1230     # at least, I should hope we dont. If this causes problems
1231     # take out the if/fi block and inform me please.
1232     # unpack_2_6 should now be 2.6.17 safe anyways
1233     if [[ ${ETYPE} == headers ]]; then
1234     kernel_is 2 4 && unpack_2_4
1235     kernel_is 2 6 && unpack_2_6
1236     fi
1237 robbat2 1.229
1238 robbat2 1.230 if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then
1239 robbat2 1.239 cp "${DISTDIR}/${DEBLOB_A}" "${T}" || die "cp ${DEBLOB_A} failed"
1240     cp "${DISTDIR}/${DEBLOB_CHECK_A}" "${T}/deblob-check" || die "cp ${DEBLOB_CHECK_A} failed"
1241     chmod +x "${T}/${DEBLOB_A}" "${T}/deblob-check" || die "chmod deblob scripts failed"
1242 robbat2 1.229 fi
1243 johnm 1.1 }
1244    
1245 plasmaroo 1.33 kernel-2_src_compile() {
1246 vapier 1.136 cd "${S}"
1247 johnm 1.93 [[ ${ETYPE} == headers ]] && compile_headers
1248 robbat2 1.229
1249 robbat2 1.230 if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then
1250 robbat2 1.229 echo ">>> Running deblob script ..."
1251     sh "${T}/${DEBLOB_A}" --force || \
1252     die "Deblob script failed to run!!!"
1253     fi
1254 johnm 1.1 }
1255    
1256 robbat2 1.240 # if you leave it to the default src_test, it will run make to
1257     # find whether test/check targets are present; since "make test"
1258     # actually produces a few support files, they are installed even
1259     # though the package is binchecks-restricted.
1260     #
1261     # Avoid this altogether by making the function moot.
1262     kernel-2_src_test() { :; }
1263    
1264 plasmaroo 1.33 kernel-2_pkg_preinst() {
1265 johnm 1.93 [[ ${ETYPE} == headers ]] && preinst_headers
1266 johnm 1.1 }
1267    
1268 plasmaroo 1.33 kernel-2_src_install() {
1269 johnm 1.1 install_universal
1270 johnm 1.93 [[ ${ETYPE} == headers ]] && install_headers
1271     [[ ${ETYPE} == sources ]] && install_sources
1272 johnm 1.1 }
1273    
1274 plasmaroo 1.33 kernel-2_pkg_postinst() {
1275 johnm 1.93 [[ ${ETYPE} == sources ]] && postinst_sources
1276 johnm 1.1 }
1277 johnm 1.12
1278 plasmaroo 1.33 kernel-2_pkg_setup() {
1279 phreak 1.192 if kernel_is 2 4; then
1280 vapier 1.264 if [[ $(gcc-major-version) -ge 4 ]] ; then
1281 phreak 1.192 echo
1282     ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with linux-2.4!"
1283     ewarn "Either switch to another gcc-version (via gcc-config) or use a"
1284     ewarn "newer kernel that supports gcc-4."
1285     echo
1286     ewarn "Also be aware that bugreports about gcc-4 not working"
1287     ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
1288     echo
1289     epause 10
1290     fi
1291     fi
1292    
1293 blubb 1.167 ABI="${KERNEL_ABI}"
1294 johnm 1.93 [[ ${ETYPE} == headers ]] && setup_headers
1295     [[ ${ETYPE} == sources ]] && echo ">>> Preparing to unpack ..."
1296 johnm 1.12 }
1297 mpagano 1.256
1298     kernel-2_pkg_postrm() {
1299 vapier 1.263 # This warning only makes sense for kernel sources.
1300     [[ ${ETYPE} == headers ]] && return 0
1301 mpagano 1.256 echo
1302     ewarn "Note: Even though you have successfully unmerged "
1303     ewarn "your kernel package, directories in kernel source location: "
1304     ewarn "${ROOT}usr/src/linux-${KV_FULL}"
1305     ewarn "with modified files will remain behind. By design, package managers"
1306     ewarn "will not remove these modified files and the directories they reside in."
1307     echo
1308     }

  ViewVC Help
Powered by ViewVC 1.1.20