/[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.153 Revision 1.159
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.153 2005/11/18 03:58:21 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.159 2006/02/17 22:18:20 swegener 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# Maintainer: John Mylchreest <johnm@gentoo.org> 8# Maintainer: John Mylchreest <johnm@gentoo.org>
131 131
132 RELEASE=${CKV/${OKV}} 132 RELEASE=${CKV/${OKV}}
133 RELEASE=${RELEASE/_beta} 133 RELEASE=${RELEASE/_beta}
134 RELEASE=${RELEASE/_rc/-rc} 134 RELEASE=${RELEASE/_rc/-rc}
135 RELEASE=${RELEASE/_pre/-pre} 135 RELEASE=${RELEASE/_pre/-pre}
136 kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-bk} 136 kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git}
137 RELEASETYPE=${RELEASE//[0-9]} 137 RELEASETYPE=${RELEASE//[0-9]}
138 138
139 # Now we know that RELEASE is the -rc/-bk 139 # Now we know that RELEASE is the -rc/-git
140 # and RELEASETYPE is the same but with its numerics stripped 140 # and RELEASETYPE is the same but with its numerics stripped
141 # we can work on better sorting EXTRAVERSION. 141 # we can work on better sorting EXTRAVERSION.
142 # first of all, we add the release 142 # first of all, we add the release
143 EXTRAVERSION="${RELEASE}" 143 EXTRAVERSION="${RELEASE}"
144 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}" 144 [[ -n ${KV_EXTRA} ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}"
175 175
176 # we will set this for backwards compatibility. 176 # we will set this for backwards compatibility.
177 S=${WORKDIR}/linux-${KV_FULL} 177 S=${WORKDIR}/linux-${KV_FULL}
178 KV=${KV_FULL} 178 KV=${KV_FULL}
179 179
180 # -rc-bk pulls can be achieved by specifying CKV 180 # -rc-git pulls can be achieved by specifying CKV
181 # for example: 181 # for example:
182 # CKV="2.6.11_rc3_pre2" 182 # CKV="2.6.11_rc3_pre2"
183 # will pull: 183 # will pull:
184 # linux-2.6.10.tar.bz2 & patch-2.6.11-rc3.bz2 & patch-2.6.11-rc3-bk2.bz2 184 # linux-2.6.10.tar.bz2 & patch-2.6.11-rc3.bz2 & patch-2.6.11-rc3-git2.bz2
185 185
186 if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then 186 if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
187 OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))" 187 OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
188 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${CKV//_/-}.bz2 188 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${CKV//_/-}.bz2
189 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 189 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
190 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.bz2" 190 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.bz2"
191 fi 191 fi
192 192
193 if [[ ${RELEASETYPE} == -bk ]]; then 193 if [[ ${RELEASETYPE} == -git ]]; then
194 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${OKV}${RELEASE}.bz2 194 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${OKV}${RELEASE}.bz2
195 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 195 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
196 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.bz2" 196 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.bz2"
197 fi 197 fi
198 198
199 if [[ ${RELEASETYPE} == -rc-bk ]]; then 199 if [[ ${RELEASETYPE} == -rc-git ]]; then
200 OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))" 200 OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
201 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2 201 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2
202 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-bk*}.bz2 202 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2
203 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 203 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
204 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-bk*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2" 204 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
205 fi 205 fi
206 206
207 handle_genpatches 207 handle_genpatches
208} 208}
209 209
462 arm) 462 arm)
463 dodir ${ddir}/asm 463 dodir ${ddir}/asm
464 cp -ax "${S}"/include/asm/* "${D}"/${ddir}/asm 464 cp -ax "${S}"/include/asm/* "${D}"/${ddir}/asm
465 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch 465 [[ ! -e ${D}/${ddir}/asm/arch ]] && ln -sf arch-ebsa285 "${D}"/${ddir}/asm/arch
466 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc 466 [[ ! -e ${D}/${ddir}/asm/proc ]] && ln -sf proc-armv "${D}"/${ddir}/asm/proc
467 ;;
468 powerpc)
469 dodir ${ddir}/asm
470 cp -ax "${S}"/include/asm/* ${D}/${ddir}/asm
471 if [[ -e "${S}"/include/asm-ppc ]] ; then
472 dodir ${ddir}/asm-ppc
473 cp -ax "${S}"/include/asm-ppc/* ${D}/${ddir}/asm-ppc
474 fi
467 ;; 475 ;;
468 *) 476 *)
469 dodir ${ddir}/asm 477 dodir ${ddir}/asm
470 cp -ax "${S}"/include/asm/* ${D}/${ddir}/asm 478 cp -ax "${S}"/include/asm/* ${D}/${ddir}/asm
471 ;; 479 ;;
935 sed -i \ 943 sed -i \
936 -e "s/\([ "$'\t'"]\)\(u\|s\)\(8\|16\|32\|64\)\([ "$'\t'"]\)/\1__\2\3\4/g;" \ 944 -e "s/\([ "$'\t'"]\)\(u\|s\)\(8\|16\|32\|64\)\([ "$'\t'"]\)/\1__\2\3\4/g;" \
937 -e 's/ \(u\|s\)\(8\|16\|32\|64\)$/ __\1\2/g' \ 945 -e 's/ \(u\|s\)\(8\|16\|32\|64\)$/ __\1\2/g' \
938 -e 's/\([(, ]\)\(u\|s\)64\([, )]\)/\1__\264\3/g' \ 946 -e 's/\([(, ]\)\(u\|s\)64\([, )]\)/\1__\264\3/g' \
939 -e "s/^\(u\|s\)\(8\|16\|32\|64\)\([ "$'\t'"]\)/__\1\2\3/g;" \ 947 -e "s/^\(u\|s\)\(8\|16\|32\|64\)\([ "$'\t'"]\)/__\1\2\3/g;" \
948 -e "s/ inline / __inline__ /g" \
940 "$@" 949 "$@"
941} 950}
942 951
943# common functions 952# common functions
944#============================================================== 953#==============================================================
945kernel-2_src_unpack() { 954kernel-2_src_unpack() {
946 universal_unpack 955 universal_unpack
947 956
948 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ 957 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
949 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" 958 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
959
960 # allow ebuilds to massage the source tree after patching but before
961 # we run misc `make` functions below
962 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
950 963
951 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion 964 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
952 unpack_fix_docbook 965 unpack_fix_docbook
953 unpack_fix_install_path 966 unpack_fix_install_path
954 967

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.159

  ViewVC Help
Powered by ViewVC 1.1.20