/[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.287 Revision 1.288
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.287 2013/07/31 21:25:50 hasufell Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.288 2013/09/05 17:04:26 tomwij 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>
38# K_SYMLINK - if this is set, then forcably create symlink anyway 38# K_SYMLINK - if this is set, then forcably create symlink anyway
39# 39#
40# K_DEFCONFIG - Allow specifying a different defconfig target. 40# K_DEFCONFIG - Allow specifying a different defconfig target.
41# If length zero, defaults to "defconfig". 41# If length zero, defaults to "defconfig".
42# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any 42# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any
43# combination of "base" and "extras" 43# combination of "base", "extras" or "experimental".
44# K_EXP_GENPATCHES_PULL - If set, we pull "experimental" regardless of the USE FLAG
45# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
46# K_EXP_GENPATCHES_NOUSE - If set, no USE flag will be provided for "experimental";
47# as a result the user cannot choose to apply those patches.
48# K_EXP_GENPATCHES_LIST - A list of patches to pick from "experimental" to apply when
49# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
44# K_GENPATCHES_VER - The version of the genpatches tarball(s) to apply. 50# 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 51# A value of "5" would apply genpatches-2.6.12-5 to
46# my-sources-2.6.12.ebuild 52# my-sources-2.6.12.ebuild
47# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security 53# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security
48# K_DEBLOB_AVAILABLE - A value of "0" will disable all of the optional deblob 54# K_DEBLOB_AVAILABLE - A value of "0" will disable all of the optional deblob
128 # genpatches for 3.0 and 3.0.1 might be named 134 # genpatches for 3.0 and 3.0.1 might be named
129 # genpatches-3.0-1.base.tar.xz and genpatches-3.0-2.base.tar.xz 135 # genpatches-3.0-1.base.tar.xz and genpatches-3.0-2.base.tar.xz
130 # respectively. Handle this. 136 # respectively. Handle this.
131 137
132 for i in ${K_WANT_GENPATCHES} ; do 138 for i in ${K_WANT_GENPATCHES} ; do
133 if [[ ${KV_MAJOR} -ge 3 ]]; then 139 if [[ ${KV_MAJOR} -ge 3 ]]; then
134 if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then 140 if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
135 tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz" 141 tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz"
142 else
143 tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
144 fi
136 else 145 else
137 tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
138 fi
139 else
140 tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz" 146 tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz"
141 fi 147 fi
148
149 local use_cond_start="" use_cond_end=""
150
151 if [[ "${i}" == "experimental" && -z ${K_EXP_GENPATCHES_PULL} && -z ${K_EXP_GENPATCHES_NOUSE} ]] ; then
152 use_cond_start="experimental? ( "
153 use_cond_end=" )"
154
155 if use experimental ; then
156 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
157 debug-print "genpatches tarball: $tarball"
158 fi
159 else
160 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
142 debug-print "genpatches tarball: $tarball" 161 debug-print "genpatches tarball: $tarball"
143 GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}" 162 fi
144 UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}" 163
164 GENPATCHES_URI+=" ${use_cond_start}mirror://gentoo/${tarball}${use_cond_end}"
145 done 165 done
146} 166}
147 167
148detect_version() { 168detect_version() {
149 # this function will detect and set 169 # this function will detect and set
952 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed" 972 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
953 else 973 else
954 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed" 974 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
955 fi 975 fi
956 fi 976 fi
977 fi
978
979 # If experimental was not chosen by the user, drop experimental patches not in K_EXP_GENPATCHES_LIST.
980 if [[ "${i}" == *"genpatches-"*".experimental."* && -n ${K_EXP_GENPATCHES_PULL} ]] ; then
981 if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then
982 continue
983 fi
984
985 local j
986 for j in ${KPATCH_DIR}/*/50*_*.patch*; do
987 if [[ ! "${K_EXP_GENPATCHES_LIST}" == *"$(basename ${j})"* ]] ; then
988 UNIPATCH_DROP+=" $(basename ${j})"
989 fi
990 done
957 fi 991 fi
958 done 992 done
959 993
960 #populate KPATCH_DIRS so we know where to look to remove the excludes 994 #populate KPATCH_DIRS so we know where to look to remove the excludes
961 x=${KPATCH_DIR} 995 x=${KPATCH_DIR}

Legend:
Removed from v.1.287  
changed lines
  Added in v.1.288

  ViewVC Help
Powered by ViewVC 1.1.20