/[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.282 Revision 1.303
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2015 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.282 2013/04/17 13:52:17 tomwij Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.303 2015/04/29 00:07:30 mpagano 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>
35# messages 35# messages
36# K_EXTRAELOG - same as K_EXTRAEINFO except using elog instead of einfo 36# 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 37# K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn instead of einfo
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_BASE_VER - for git-sources, declare the base version this patch is
41# based off of.
40# K_DEFCONFIG - Allow specifying a different defconfig target. 42# K_DEFCONFIG - Allow specifying a different defconfig target.
41# If length zero, defaults to "defconfig". 43# If length zero, defaults to "defconfig".
42# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any 44# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any
43# combination of "base" and "extras" 45# combination of "base", "extras" or "experimental".
46# K_EXP_GENPATCHES_PULL - If set, we pull "experimental" regardless of the USE FLAG
47# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
48# K_EXP_GENPATCHES_NOUSE - If set, no USE flag will be provided for "experimental";
49# as a result the user cannot choose to apply those patches.
50# K_EXP_GENPATCHES_LIST - A list of patches to pick from "experimental" to apply when
51# 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. 52# 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 53# A value of "5" would apply genpatches-2.6.12-5 to
46# my-sources-2.6.12.ebuild 54# my-sources-2.6.12.ebuild
47# K_SECURITY_UNSUPPORTED- If set, this kernel is unsupported by Gentoo Security 55# 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 56# K_DEBLOB_AVAILABLE - A value of "0" will disable all of the optional deblob
72# Changing any other variable in this eclass is not supported; you can request 80# Changing any other variable in this eclass is not supported; you can request
73# for additional variables to be added by contacting the current maintainer. 81# for additional variables to be added by contacting the current maintainer.
74# If you do change them, there is a chance that we will not fix resulting bugs; 82# If you do change them, there is a chance that we will not fix resulting bugs;
75# that of course does not mean we're not willing to help. 83# that of course does not mean we're not willing to help.
76 84
85PYTHON_COMPAT=( python{2_6,2_7} )
86
77inherit eutils toolchain-funcs versionator multilib 87inherit eutils toolchain-funcs versionator multilib python-any-r1
78EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm 88EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
79 89
80# Added by Daniel Ostrow <dostrow@gentoo.org> 90# Added by Daniel Ostrow <dostrow@gentoo.org>
81# This is an ugly hack to get around an issue with a 32-bit userland on ppc64. 91# This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
82# I will remove it when I come up with something more reasonable. 92# I will remove it when I come up with something more reasonable.
128 # genpatches for 3.0 and 3.0.1 might be named 138 # 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 139 # genpatches-3.0-1.base.tar.xz and genpatches-3.0-2.base.tar.xz
130 # respectively. Handle this. 140 # respectively. Handle this.
131 141
132 for i in ${K_WANT_GENPATCHES} ; do 142 for i in ${K_WANT_GENPATCHES} ; do
133 if [[ ${KV_MAJOR} -ge 3 ]]; then 143 if [[ ${KV_MAJOR} -ge 3 ]]; then
134 if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then 144 if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
135 tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz" 145 tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz"
146 else
147 tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
148 fi
136 else 149 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" 150 tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz"
141 fi 151 fi
152
153 local use_cond_start="" use_cond_end=""
154
155 if [[ "${i}" == "experimental" && -z ${K_EXP_GENPATCHES_PULL} && -z ${K_EXP_GENPATCHES_NOUSE} ]] ; then
156 use_cond_start="experimental? ( "
157 use_cond_end=" )"
158
159 if use experimental ; then
160 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
161 debug-print "genpatches tarball: $tarball"
162 fi
163 else
164 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
142 debug-print "genpatches tarball: $tarball" 165 debug-print "genpatches tarball: $tarball"
143 GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}" 166 fi
144 UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}" 167 GENPATCHES_URI+=" ${use_cond_start}mirror://gentoo/${tarball}${use_cond_end}"
145 done 168 done
146} 169}
147 170
148detect_version() { 171detect_version() {
149 # this function will detect and set 172 # this function will detect and set
210 233
211# if [[ ${KV_MAJOR} -ge 3 ]]; then 234# if [[ ${KV_MAJOR} -ge 3 ]]; then
212 if [[ ${#OKV_ARRAY[@]} -lt 3 ]]; then 235 if [[ ${#OKV_ARRAY[@]} -lt 3 ]]; then
213 KV_PATCH_ARR=(${KV_PATCH//\./ }) 236 KV_PATCH_ARR=(${KV_PATCH//\./ })
214 237
215 # at this point 031412, Linus is putting all 3.x kernels in a 238 # at this point 031412, Linus is putting all 3.x kernels in a
216 # 3.x directory, may need to revisit when 4.x is released 239 # 3.x directory, may need to revisit when 4.x is released
217 KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.x" 240 KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.x"
218 241
219 [[ -n "${K_LONGTERM}" ]] && 242 [[ -n "${K_LONGTERM}" ]] &&
220 KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_PATCH_ARR}" 243 KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_PATCH_ARR}"
337 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz" 360 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
338 361
339 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.xz" 362 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.xz"
340 fi 363 fi
341 else 364 else
365 KV_PATCH_ARR=(${KV_PATCH//\./ })
366
367 # the different majorminor versions have different patch start versions
368 OKV_DICT=(["2"]="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))" ["3"]="2.6.39" ["4"]="3.19")
369
342 if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then 370 if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
343 if [[ ${KV_MAJOR}${KV_PATCH} -eq 30 ]]; then 371 OKV=${K_BASE_VER:-$OKV_DICT["${KV_MAJOR}"]}
344 OKV="2.6.39"
345 else
346 KV_PATCH_ARR=(${KV_PATCH//\./ })
347 OKV="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))"
348 fi
349 KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.xz 372 KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.xz
350 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz" 373 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
351 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.xz" 374 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.xz"
352 fi 375 fi
353 376
356 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz" 379 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
357 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.xz" 380 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.xz"
358 fi 381 fi
359 382
360 if [[ ${RELEASETYPE} == -rc-git ]]; then 383 if [[ ${RELEASETYPE} == -rc-git ]]; then
361 if [[ ${KV_MAJOR}${KV_PATCH} -eq 30 ]]; then 384 OKV=${K_BASE_VER:-$OKV_DICT["${KV_MAJOR}"]}
362 OKV="2.6.39"
363 else
364 KV_PATCH_ARR=(${KV_PATCH//\./ })
365 OKV="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))"
366 fi
367 KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz 385 KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz
368 ${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz 386 ${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz
369 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz" 387 ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
370 388
371 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz" 389 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz"
372 fi 390 fi
373 391
374 392
375 fi 393 fi
376 394
377
378 debug-print-kernel2-variables 395 debug-print-kernel2-variables
379 396
380 handle_genpatches 397 handle_genpatches
381} 398}
382 399
415 kernel_is 2 6 || kernel_is 2 5 432 kernel_is 2 6 || kernel_is 2 5
416} 433}
417 434
418# Capture the sources type and set DEPENDs 435# Capture the sources type and set DEPENDs
419if [[ ${ETYPE} == sources ]]; then 436if [[ ${ETYPE} == sources ]]; then
420 DEPEND="!build? ( sys-apps/sed 437 DEPEND="!build? (
438 sys-apps/sed
421 >=sys-devel/binutils-2.11.90.0.31 )" 439 >=sys-devel/binutils-2.11.90.0.31
422 RDEPEND="!build? ( >=sys-libs/ncurses-5.2 440 )"
441 RDEPEND="!build? (
442 >=sys-libs/ncurses-5.2
423 sys-devel/make 443 sys-devel/make
424 dev-lang/perl 444 dev-lang/perl
425 sys-devel/bc )" 445 sys-devel/bc
446 )"
426 PDEPEND="!build? ( virtual/dev-manager )" 447 PDEPEND="!build? ( virtual/dev-manager )"
427 448
428 SLOT="${PVR}" 449 SLOT="${PVR}"
429 DESCRIPTION="Sources based on the Linux Kernel." 450 DESCRIPTION="Sources based on the Linux Kernel."
430 IUSE="symlink build" 451 IUSE="symlink build"
436 [[ -z "${K_DEBLOB_AVAILABLE}" ]] && \ 457 [[ -z "${K_DEBLOB_AVAILABLE}" ]] && \
437 kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \ 458 kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \
438 K_DEBLOB_AVAILABLE=1 459 K_DEBLOB_AVAILABLE=1
439 if [[ ${K_DEBLOB_AVAILABLE} == "1" ]] ; then 460 if [[ ${K_DEBLOB_AVAILABLE} == "1" ]] ; then
440 IUSE="${IUSE} deblob" 461 IUSE="${IUSE} deblob"
462
441 # Reflect that kernels contain firmware blobs unless otherwise 463 # Reflect that kernels contain firmware blobs unless otherwise
442 # stripped 464 # stripped
443 LICENSE="${LICENSE} !deblob? ( freedist )" 465 LICENSE="${LICENSE} !deblob? ( freedist )"
466
467 DEPEND+=" deblob? ( ${PYTHON_DEPS} )"
444 468
445 if [[ -n KV_MINOR ]]; then 469 if [[ -n KV_MINOR ]]; then
446 DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" 470 DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
447 else 471 else
448 DEBLOB_PV="${KV_MAJOR}.${KV_PATCH}" 472 DEBLOB_PV="${KV_MAJOR}.${KV_PATCH}"
462 DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}" 486 DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
463 fi 487 fi
464 DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}" 488 DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}"
465 HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}" 489 HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
466 490
467 DEPEND+=" deblob? ( =dev-lang/python-2* )"
468 KERNEL_URI="${KERNEL_URI} 491 KERNEL_URI="${KERNEL_URI}
469 deblob? ( 492 deblob? (
470 ${DEBLOB_URI} 493 ${DEBLOB_URI}
471 ${DEBLOB_CHECK_URI} 494 ${DEBLOB_CHECK_URI}
472 )" 495 )"
687 if kernel_is ge 2 6 18 ; then 710 if kernel_is ge 2 6 18 ; then
688 env_setup_xmakeopts 711 env_setup_xmakeopts
689 emake headers_install INSTALL_HDR_PATH="${D}"/${ddir}/.. ${xmakeopts} || die 712 emake headers_install INSTALL_HDR_PATH="${D}"/${ddir}/.. ${xmakeopts} || die
690 713
691 # let other packages install some of these headers 714 # let other packages install some of these headers
692 rm -rf "${D}"/${ddir}/sound #alsa-headers
693 rm -rf "${D}"/${ddir}/scsi #glibc/uclibc/etc... 715 rm -rf "${D}"/${ddir}/scsi #glibc/uclibc/etc...
694 return 0 716 return 0
695 fi 717 fi
696 718
697 # Do not use "linux/*" as that can cause problems with very long 719 # Do not use "linux/*" as that can cause problems with very long
740 > "${S}"/patches.txt 762 > "${S}"/patches.txt
741 fi 763 fi
742 764
743 mv ${WORKDIR}/linux* "${D}"/usr/src 765 mv ${WORKDIR}/linux* "${D}"/usr/src
744 766
745 if [[ -z ${UNIPATCH_DOCS} ]] ; then 767 if [[ -n "${UNIPATCH_DOCS}" ]] ; then
746 dodoc ${UNIPATCH_DOCS} 768 for i in ${UNIPATCH_DOCS}; do
769 dodoc "${T}"/${i}
770 done
747 fi 771 fi
748} 772}
749 773
750# pkg_preinst functions 774# pkg_preinst functions
751#============================================================== 775#==============================================================
811 fi 835 fi
812 836
813 # optionally display security unsupported message 837 # optionally display security unsupported message
814 # Start with why 838 # Start with why
815 if [[ ${K_SECURITY_UNSUPPORTED} = deblob ]]; then 839 if [[ ${K_SECURITY_UNSUPPORTED} = deblob ]]; then
816 ewarn "Deblobbed kernels are UNSUPPORTED by Gentoo Security." 840 ewarn "Deblobbed kernels may not be up-to-date security-wise"
841 ewarn "as they depend on external scripts."
817 elif [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then 842 elif [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
818 ewarn "${PN} is UNSUPPORTED by Gentoo Security." 843 ewarn "${PN} is UNSUPPORTED by Gentoo Security."
819 fi 844 fi
820 # And now the general message. 845 # And now the general message.
821 if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then 846 if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
827 # warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765) 852 # warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765)
828 KV_MAJOR=$(get_version_component_range 1 ${OKV}) 853 KV_MAJOR=$(get_version_component_range 1 ${OKV})
829 KV_MINOR=$(get_version_component_range 2 ${OKV}) 854 KV_MINOR=$(get_version_component_range 2 ${OKV})
830 KV_PATCH=$(get_version_component_range 3 ${OKV}) 855 KV_PATCH=$(get_version_component_range 3 ${OKV})
831 if [[ "$(tc-arch)" = "sparc" ]]; then 856 if [[ "$(tc-arch)" = "sparc" ]]; then
857 if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 ]]; then
832 if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] 858 if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then
833 then
834 echo 859 echo
835 elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that" 860 elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that"
836 elog "you now need to do" 861 elog "you now need to do"
837 elog " make CROSS_COMPILE=sparc64-unknown-linux-gnu-" 862 elog " make CROSS_COMPILE=sparc64-unknown-linux-gnu-"
838 elog "instead of just" 863 elog "instead of just"
839 elog " make" 864 elog " make"
840 elog "to compile the kernel. For more information please browse to" 865 elog "to compile the kernel. For more information please browse to"
841 elog "https://bugs.gentoo.org/show_bug.cgi?id=214765" 866 elog "https://bugs.gentoo.org/show_bug.cgi?id=214765"
842 echo 867 echo
868 fi
843 fi 869 fi
844 fi 870 fi
845} 871}
846 872
847# pkg_setup functions 873# pkg_setup functions
914 PIPE_CMD="" 940 PIPE_CMD=""
915 case ${extention} in 941 case ${extention} in
916 xz) PIPE_CMD="xz -dc";; 942 xz) PIPE_CMD="xz -dc";;
917 lzma) PIPE_CMD="lzma -dc";; 943 lzma) PIPE_CMD="lzma -dc";;
918 bz2) PIPE_CMD="bzip2 -dc";; 944 bz2) PIPE_CMD="bzip2 -dc";;
919 patch) PIPE_CMD="cat";; 945 patch*) PIPE_CMD="cat";;
920 diff) PIPE_CMD="cat";; 946 diff) PIPE_CMD="cat";;
921 gz|Z|z) PIPE_CMD="gzip -dc";; 947 gz|Z|z) PIPE_CMD="gzip -dc";;
922 ZIP|zip) PIPE_CMD="unzip -p";; 948 ZIP|zip) PIPE_CMD="unzip -p";;
923 *) UNIPATCH_DROP="${UNIPATCH_DROP} ${i/:*/}";; 949 *) UNIPATCH_DROP="${UNIPATCH_DROP} ${i/:*/}";;
924 esac 950 esac
948 974
949 mkdir -p ${KPATCH_DIR}/${PATCH_ORDER}/ 975 mkdir -p ${KPATCH_DIR}/${PATCH_ORDER}/
950 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed" 976 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
951 else 977 else
952 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed" 978 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
979 fi
980 fi
981 fi
982
983 # If experimental was not chosen by the user, drop experimental patches not in K_EXP_GENPATCHES_LIST.
984 if [[ "${i}" == *"genpatches-"*".experimental."* && -n ${K_EXP_GENPATCHES_PULL} ]] ; then
985 if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then
986 continue
987 fi
988
989 local j
990 for j in ${KPATCH_DIR}/*/50*_*.patch*; do
991 for k in ${K_EXP_GENPATCHES_LIST} ; do
992 [[ "$(basename ${j})" == ${k}* ]] && continue 2
993 done
994 UNIPATCH_DROP+=" $(basename ${j})"
995 done
996 else
997 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
998 debug-print "genpatches tarball: $tarball"
999
1000 # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010
1001 if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then
1002 # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch
1003 if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then
1004 UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
1005 fi
1006 else
1007 if [[ $UNIPATCH_DROP != *"5000_enable-additional-cpu-optimizations-for-gcc.patch"* ]]; then
1008 #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
1009 UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
953 fi 1010 fi
954 fi 1011 fi
955 fi 1012 fi
956 done 1013 done
957 1014
991 1048
992 [ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/} 1049 [ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/}
993 #[ -z ${i/*.diff*/} ] && PATCH_DEPTH=${i/*.diff/} 1050 #[ -z ${i/*.diff*/} ] && PATCH_DEPTH=${i/*.diff/}
994 1051
995 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi 1052 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
1053
1054 ####################################################################
1055 # IMPORTANT: This is temporary code to support Linux git 3.15_rc1! #
1056 # #
1057 # The patch contains a removal of a symlink, followed by addition #
1058 # of a file with the same name as the symlink in the same #
1059 # location; this causes the dry-run to fail, filed bug #507656. #
1060 # #
1061 # https://bugs.gentoo.org/show_bug.cgi?id=507656 #
1062 ####################################################################
1063 if [[ ${PN} == "git-sources" ]] ; then
1064 if [[ ${KV_MAJOR}${KV_PATCH} -ge 315 && ${RELEASETYPE} == -rc ]] ; then
1065 ebegin "Applying ${i/*\//} (-p1)"
1066 if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then
1067 eend 0
1068 rm ${STDERR_T}
1069 break
1070 else
1071 eend 1
1072 eerror "Failed to apply patch ${i/*\//}"
1073 eerror "Please attach ${STDERR_T} to any bug you may post."
1074 eshopts_pop
1075 die "Failed to apply ${i/*\//} on patch depth 1."
1076 fi
1077 fi
1078 fi
1079 ####################################################################
996 1080
997 while [ ${PATCH_DEPTH} -lt 5 ]; do 1081 while [ ${PATCH_DEPTH} -lt 5 ]; do
998 echo "Attempting Dry-run:" >> ${STDERR_T} 1082 echo "Attempting Dry-run:" >> ${STDERR_T}
999 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T} 1083 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T}
1000 echo "=======================================================" >> ${STDERR_T} 1084 echo "=======================================================" >> ${STDERR_T}
1038 # them during the install phase. 1122 # them during the install phase.
1039 local tmp 1123 local tmp
1040 for x in ${KPATCH_DIR}; do 1124 for x in ${KPATCH_DIR}; do
1041 for i in ${UNIPATCH_DOCS}; do 1125 for i in ${UNIPATCH_DOCS}; do
1042 if [[ -f "${x}/${i}" ]] ; then 1126 if [[ -f "${x}/${i}" ]] ; then
1043 tmp="${tmp} \"${T}/${i}\"" 1127 tmp="${tmp} ${i}"
1044 cp -f "${x}/${i}" "${T}"/ 1128 cp -f "${x}/${i}" "${T}"/
1045 fi 1129 fi
1046 done 1130 done
1047 done 1131 done
1048 UNIPATCH_DOCS="${tmp}" 1132 UNIPATCH_DOCS="${tmp}"
1166 fi 1250 fi
1167 1251
1168 # fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox 1252 # fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox
1169 # only do this for kernel < 2.6.27 since this file does not exist in later 1253 # only do this for kernel < 2.6.27 since this file does not exist in later
1170 # kernels 1254 # kernels
1171 if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] 1255 if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then
1172 then
1173 sed -i \ 1256 sed -i \
1174 -e "s|TOUT := .tmp_gas_check|TOUT := \"${T}\"/.tmp_gas_check|" \ 1257 -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \
1175 "${S}"/arch/ppc/Makefile 1258 "${S}"/arch/ppc/Makefile
1176 else 1259 else
1177 sed -i \ 1260 sed -i \
1178 -e "s|TOUT := .tmp_gas_check|TOUT := \"${T}\"/.tmp_gas_check|" \ 1261 -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \
1179 "${S}"/arch/powerpc/Makefile 1262 "${S}"/arch/powerpc/Makefile
1180 fi 1263 fi
1181} 1264}
1182 1265
1183kernel-2_src_compile() { 1266kernel-2_src_compile() {
1184 cd "${S}" 1267 cd "${S}"
1185 [[ ${ETYPE} == headers ]] && compile_headers 1268 [[ ${ETYPE} == headers ]] && compile_headers
1186 1269
1187 if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then 1270 if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then
1188 echo ">>> Running deblob script ..." 1271 echo ">>> Running deblob script ..."
1272 python_setup
1189 EPYTHON="python2" sh "${T}/${DEBLOB_A}" --force || die "Deblob script failed to run!!!" 1273 sh "${T}/${DEBLOB_A}" --force || die "Deblob script failed to run!!!"
1190 fi 1274 fi
1191} 1275}
1192 1276
1193# if you leave it to the default src_test, it will run make to 1277# if you leave it to the default src_test, it will run make to
1194# find whether test/check targets are present; since "make test" 1278# find whether test/check targets are present; since "make test"

Legend:
Removed from v.1.282  
changed lines
  Added in v.1.303

  ViewVC Help
Powered by ViewVC 1.1.20