/[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.280 Revision 1.282
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.280 2013/03/20 07:55:54 tomwij Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.282 2013/04/17 13:52:17 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>
67# UNIPATCH_DOCS - space delimemeted list of docs to be installed to 67# UNIPATCH_DOCS - space delimemeted list of docs to be installed to
68# the doc dir 68# the doc dir
69# UNIPATCH_STRICTORDER - if this is set places patches into directories of 69# UNIPATCH_STRICTORDER - if this is set places patches into directories of
70# order, so they are applied in the order passed 70# order, so they are applied in the order passed
71 71
72# 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.
74# 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.
76
72inherit eutils toolchain-funcs versionator multilib 77inherit eutils toolchain-funcs versionator multilib
73EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm 78EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
74 79
75# Added by Daniel Ostrow <dostrow@gentoo.org> 80# 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. 81# This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
419 dev-lang/perl 424 dev-lang/perl
420 sys-devel/bc )" 425 sys-devel/bc )"
421 PDEPEND="!build? ( virtual/dev-manager )" 426 PDEPEND="!build? ( virtual/dev-manager )"
422 427
423 SLOT="${PVR}" 428 SLOT="${PVR}"
424 DESCRIPTION="Sources for the ${KV_MAJOR}.${KV_MINOR:-$KV_PATCH} linux kernel" 429 DESCRIPTION="Sources based on the Linux Kernel."
425 IUSE="symlink build" 430 IUSE="symlink build"
426 431
427 # Bug #266157, deblob for libre support 432 # Bug #266157, deblob for libre support
428 if [[ -z ${K_PREDEBLOBBED} ]] ; then 433 if [[ -z ${K_PREDEBLOBBED} ]] ; then
429 # Bug #359865, force a call to detect_version if needed 434 # Bug #359865, force a call to detect_version if needed
665} 670}
666 671
667# install functions 672# install functions
668#============================================================== 673#==============================================================
669install_universal() { 674install_universal() {
670 #fix silly permissions in tarball 675 # Fix silly permissions in tarball
671 cd "${WORKDIR}" 676 cd "${WORKDIR}"
672 chown -R root:0 * >& /dev/null 677 chown -R 0:0 * >& /dev/null
673 chmod -R a+r-w+X,u+w * 678 chmod -R a+r-w+X,u+w *
674 cd ${OLDPWD} 679 cd ${OLDPWD}
675} 680}
676 681
677install_headers() { 682install_headers() {
734 echo "Please check the ebuild ChangeLog for more details." \ 739 echo "Please check the ebuild ChangeLog for more details." \
735 > "${S}"/patches.txt 740 > "${S}"/patches.txt
736 fi 741 fi
737 742
738 mv ${WORKDIR}/linux* "${D}"/usr/src 743 mv ${WORKDIR}/linux* "${D}"/usr/src
744
745 if [[ -z ${UNIPATCH_DOCS} ]] ; then
746 dodoc ${UNIPATCH_DOCS}
747 fi
739} 748}
740 749
741# pkg_preinst functions 750# pkg_preinst functions
742#============================================================== 751#==============================================================
743preinst_headers() { 752preinst_headers() {
983 [ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/} 992 [ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/}
984 #[ -z ${i/*.diff*/} ] && PATCH_DEPTH=${i/*.diff/} 993 #[ -z ${i/*.diff*/} ] && PATCH_DEPTH=${i/*.diff/}
985 994
986 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi 995 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
987 996
988 ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)"
989 while [ ${PATCH_DEPTH} -lt 5 ]; do 997 while [ ${PATCH_DEPTH} -lt 5 ]; do
990 echo "Attempting Dry-run:" >> ${STDERR_T} 998 echo "Attempting Dry-run:" >> ${STDERR_T}
991 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T} 999 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T}
992 echo "=======================================================" >> ${STDERR_T} 1000 echo "=======================================================" >> ${STDERR_T}
993 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then 1001 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then
1002 ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH})"
994 echo "Attempting patch:" > ${STDERR_T} 1003 echo "Attempting patch:" > ${STDERR_T}
995 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T} 1004 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T}
996 echo "=======================================================" >> ${STDERR_T} 1005 echo "=======================================================" >> ${STDERR_T}
997 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then 1006 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then
998 eend 0 1007 eend 0
1001 else 1010 else
1002 eend 1 1011 eend 1
1003 eerror "Failed to apply patch ${i/*\//}" 1012 eerror "Failed to apply patch ${i/*\//}"
1004 eerror "Please attach ${STDERR_T} to any bug you may post." 1013 eerror "Please attach ${STDERR_T} to any bug you may post."
1005 eshopts_pop 1014 eshopts_pop
1006 die "Failed to apply ${i/*\//}" 1015 die "Failed to apply ${i/*\//} on patch depth ${PATCH_DEPTH}."
1007 fi 1016 fi
1008 else 1017 else
1009 PATCH_DEPTH=$((${PATCH_DEPTH} + 1)) 1018 PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
1010 fi 1019 fi
1011 done 1020 done
1012 if [ ${PATCH_DEPTH} -eq 5 ]; then 1021 if [ ${PATCH_DEPTH} -eq 5 ]; then
1013 eend 1 1022 eerror "Failed to dry-run patch ${i/*\//}"
1014 eerror "Please attach ${STDERR_T} to any bug you may post." 1023 eerror "Please attach ${STDERR_T} to any bug you may post."
1015 eshopts_pop 1024 eshopts_pop
1016 die "Unable to dry-run patch." 1025 die "Unable to dry-run patch on any patch depth lower than 5."
1017 fi 1026 fi
1018 done 1027 done
1019 done 1028 done
1020 1029
1021 # This is a quick, and kind of nasty hack to deal with UNIPATCH_DOCS which 1030 # When genpatches is used, we want to install 0000_README which documents
1022 # sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite, 1031 # the patches that were used; such that the user can see them, bug #301478.
1023 # which is why I'm not taking too much time over this. 1032 if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
1033 UNIPATCH_DOCS="${UNIPATCH_DOCS} 0000_README"
1034 fi
1035
1036 # When files listed in UNIPATCH_DOCS are found in KPATCH_DIR's, we copy it
1037 # to the temporary directory and remember them in UNIPATCH_DOCS to install
1038 # them during the install phase.
1024 local tmp 1039 local tmp
1040 for x in ${KPATCH_DIR}; do
1025 for i in ${UNIPATCH_DOCS}; do 1041 for i in ${UNIPATCH_DOCS}; do
1026 tmp="${tmp} ${i//*\/}" 1042 if [[ -f "${x}/${i}" ]] ; then
1043 tmp="${tmp} \"${T}/${i}\""
1027 cp -f ${i} "${T}"/ 1044 cp -f "${x}/${i}" "${T}"/
1045 fi
1046 done
1028 done 1047 done
1029 UNIPATCH_DOCS="${tmp}" 1048 UNIPATCH_DOCS="${tmp}"
1030 1049
1031 # clean up KPATCH_DIR's - fixes bug #53610 1050 # clean up KPATCH_DIR's - fixes bug #53610
1032 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done 1051 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
1150 # only do this for kernel < 2.6.27 since this file does not exist in later 1169 # only do this for kernel < 2.6.27 since this file does not exist in later
1151 # kernels 1170 # kernels
1152 if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] 1171 if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]]
1153 then 1172 then
1154 sed -i \ 1173 sed -i \
1155 -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ 1174 -e "s|TOUT := .tmp_gas_check|TOUT := \"${T}\"/.tmp_gas_check|" \
1156 "${S}"/arch/ppc/Makefile 1175 "${S}"/arch/ppc/Makefile
1157 else 1176 else
1158 sed -i \ 1177 sed -i \
1159 -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ 1178 -e "s|TOUT := .tmp_gas_check|TOUT := \"${T}\"/.tmp_gas_check|" \
1160 "${S}"/arch/powerpc/Makefile 1179 "${S}"/arch/powerpc/Makefile
1161 fi 1180 fi
1162} 1181}
1163 1182
1164kernel-2_src_compile() { 1183kernel-2_src_compile() {

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

  ViewVC Help
Powered by ViewVC 1.1.20