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

Diff of /eclass/kernel-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.228 Revision 1.229
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.228 2010/04/26 06:48:33 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.229 2010/04/26 07:15:03 robbat2 Exp $
4 4
5# Description: kernel.eclass rewrite for a clean base regarding the 2.6 5# Description: kernel.eclass rewrite for a clean base regarding the 2.6
6# series of kernel with back-compatibility for 2.4 6# series of kernel with back-compatibility for 2.4
7# 7#
8# Original author: John Mylchreest <johnm@gentoo.org> 8# Original author: John Mylchreest <johnm@gentoo.org>
72if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then 72if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
73 export CTARGET=${CATEGORY/cross-} 73 export CTARGET=${CATEGORY/cross-}
74fi 74fi
75 75
76HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}" 76HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}"
77# Reflect that kernels contain firmware blobs unless otherwise stripped
78[[ -z ${LICENSE} ]] && \ 77[[ -z ${LICENSE} ]] && \
79 LICENSE="GPL-2 freedist" 78 LICENSE="GPL-2"
80 79
81# No need to run scanelf/strip on kernel sources/headers (bug #134453). 80# No need to run scanelf/strip on kernel sources/headers (bug #134453).
82RESTRICT="binchecks strip" 81RESTRICT="binchecks strip"
83 82
84# set LINUX_HOSTCFLAGS if not already set 83# set LINUX_HOSTCFLAGS if not already set
298 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa" 297 kernel_is gt 2 4 && PROVIDE="${PROVIDE} virtual/alsa"
299 298
300 SLOT="${PVR}" 299 SLOT="${PVR}"
301 DESCRIPTION="Sources for the ${KV_MAJOR}.${KV_MINOR} linux kernel" 300 DESCRIPTION="Sources for the ${KV_MAJOR}.${KV_MINOR} linux kernel"
302 IUSE="symlink build" 301 IUSE="symlink build"
302
303 # Bug #266157, deblob for libre support
304 if [[ -z ${KERNEL_DEBLOBBED} ]] ; then
305 if kernel_is ge 2 6 27 ; then
306 IUSE="${IUSE} deblob"
307 # Reflect that kernels contain firmware blobs unless otherwise
308 # stripped
309 LICENSE="${LICENSE} !deblob? ( freedist )"
310
311 # This to to avoid us triggering some QA warnings
312 DEBLOB_AVAILABLE=1
313
314 DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
315 DEBLOB_A="deblob-${DEBLOB_PV}"
316 DEBLOB_HOMEPAGE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
317 HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
318
319 KERNEL_URI="${KERNEL_URI}
320 deblob? (
321 ${DEBLOB_HOMEPAGE}/download/releases/LATEST-${DEBLOB_PV}.N/${DEBLOB_A}
322 )"
323 else
324 # We have no way to deblob older kernels, so just mark them as
325 # tainted with non-libre materials.
326 LICENSE="${LICENSE} freedist"
327 fi
328 fi
329
303elif [[ ${ETYPE} == headers ]]; then 330elif [[ ${ETYPE} == headers ]]; then
304 DESCRIPTION="Linux system headers" 331 DESCRIPTION="Linux system headers"
305 332
306 # Since we should NOT honour KBUILD_OUTPUT in headers 333 # Since we should NOT honour KBUILD_OUTPUT in headers
307 # lets unset it here. 334 # lets unset it here.
624 local MAKELINK=0 651 local MAKELINK=0
625 652
626 # if we have USE=symlink, then force K_SYMLINK=1 653 # if we have USE=symlink, then force K_SYMLINK=1
627 use symlink && K_SYMLINK=1 654 use symlink && K_SYMLINK=1
628 655
656 # if we're using a deblobbed kernel, it's not supported
657 [[ $DEBLOB_AVAILABLE == "1" ]] && \
658 use deblob && \
659 K_SECURITY_UNSUPPORTED=1
660
629 # if we are to forcably symlink, delete it if it already exists first. 661 # if we are to forcably symlink, delete it if it already exists first.
630 if [[ ${K_SYMLINK} > 0 ]]; then 662 if [[ ${K_SYMLINK} > 0 ]]; then
631 [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux 663 [[ -h ${ROOT}usr/src/linux ]] && rm ${ROOT}usr/src/linux
632 MAKELINK=1 664 MAKELINK=1
633 fi 665 fi
1064 # unpack_2_6 should now be 2.6.17 safe anyways 1096 # unpack_2_6 should now be 2.6.17 safe anyways
1065 if [[ ${ETYPE} == headers ]]; then 1097 if [[ ${ETYPE} == headers ]]; then
1066 kernel_is 2 4 && unpack_2_4 1098 kernel_is 2 4 && unpack_2_4
1067 kernel_is 2 6 && unpack_2_6 1099 kernel_is 2 6 && unpack_2_6
1068 fi 1100 fi
1101
1102 if [[ $DEBLOB_AVAILABLE == "1" ]] && use deblob ; then
1103 cp "${DISTDIR}/${DEBLOB_A}" "${T}"
1104 chmod +x "${T}/${DEBLOB_A}"
1105 fi
1069} 1106}
1070 1107
1071kernel-2_src_compile() { 1108kernel-2_src_compile() {
1072 cd "${S}" 1109 cd "${S}"
1073 [[ ${ETYPE} == headers ]] && compile_headers 1110 [[ ${ETYPE} == headers ]] && compile_headers
1111
1112 if [[ $DEBLOB_AVAILABLE == "1" ]] && use deblob ; then
1113 echo ">>> Running deblob script ..."
1114 sh "${T}/${DEBLOB_A}" --force || \
1115 die "Deblob script failed to run!!!"
1116 fi
1074} 1117}
1075 1118
1076kernel-2_pkg_preinst() { 1119kernel-2_pkg_preinst() {
1077 [[ ${ETYPE} == headers ]] && preinst_headers 1120 [[ ${ETYPE} == headers ]] && preinst_headers
1078} 1121}

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.229

  ViewVC Help
Powered by ViewVC 1.1.20