diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 0345061631..86ecea923e 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1453,42 +1453,76 @@ headers___fix() { # @FUNCTION: kernel-2_src_unpack # @USAGE: # @DESCRIPTION: -# unpack sources, handle genpatches, deblob +# unpack sources kernel-2_src_unpack() { universal_unpack + + # Setup xmakeopts and cd into sourcetree. + env_setup_xmakeopts + cd "${S}" + + # We dont need a version.h for anything other than headers + # at least, I should hope we don't. If this causes problems + # take out the if/fi block and inform me please. + # unpack_2_6 should now be 2.6.17 safe anyways + if [[ ${ETYPE} == headers ]]; then + debug-print "Doing headers" + kernel_is 2 4 && unpack_2_4 + kernel_is 2 6 && unpack_2_6 + fi +} + +# @FUNCTION: kernel-2_src_prepare +# @USAGE: +# @DESCRIPTION: +# handle genpatches and user patches, deblob + +kernel-2_src_prepare() { debug-print "Doing unipatch" + # Setup xmakeopts and cd into sourcetree. + env_setup_xmakeopts + pushd "${S}" >/dev/null || die + # request UNIPATCH_LIST_GENPATCHES in phase since it calls 'use' handle_genpatches --set-unipatch-list [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" - debug-print "Doing premake" + # apply any user patches + debug-print "Applying any user patches" - # allow ebuilds to massage the source tree after patching but before - # we run misc `make` functions below - [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake + # Reset path which was changed for unipatch so that user patches + # don't need a special offset + popd >/dev/null || die - debug-print "Doing unpack_set_extraversion" + case ${EAPI:-0} in + 0|1|2|3|4|5) epatch_user ;; + 6) eapply_user ;; + esac - [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion - unpack_fix_install_path + # Back to $S -- not sure if really needed but this was the original + # working directory before we moved code from _src_unpack to _src_prepare + # so restore path to ensure that we don't break previous code + pushd "${S}" >/dev/null || die - # Setup xmakeopts and cd into sourcetree. - env_setup_xmakeopts - cd "${S}" + # allow ebuilds to massage the source tree after patching but before + # we run misc `make` functions below + if [[ $(type -t kernel-2_hook_premake) == "function" ]]; then + debug-print "Doing kernel-2_hook_premake" + kernel-2_hook_premake + fi - # We dont need a version.h for anything other than headers - # at least, I should hope we dont. If this causes problems - # take out the if/fi block and inform me please. - # unpack_2_6 should now be 2.6.17 safe anyways - if [[ ${ETYPE} == headers ]]; then - kernel_is 2 4 && unpack_2_4 - kernel_is 2 6 && unpack_2_6 + if [[ -z ${K_NOSETEXTRAVERSION} ]]; then + debug-print "Doing unpack_set_extraversion" + unpack_set_extraversion fi + unpack_fix_install_path + if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then + debug-print "Handle deblob" cp "${DISTDIR}/${DEBLOB_A}" "${T}" || die "cp ${DEBLOB_A} failed" cp "${DISTDIR}/${DEBLOB_CHECK_A}" "${T}/deblob-check" || die "cp ${DEBLOB_CHECK_A} failed" chmod +x "${T}/${DEBLOB_A}" "${T}/deblob-check" || die "chmod deblob scripts failed" @@ -1498,32 +1532,18 @@ kernel-2_src_unpack() { # only do this for kernel < 2.6.27 since this file does not exist in later # kernels if [[ -n ${KV_MINOR} && ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then + debug-print "TOUT fix for =kernel-2.6.27 applied" sed -i \ -e 's|TOUT := .tmp_gas_check|TOUT := $(T).tmp_gas_check|' \ "${S}"/arch/powerpc/Makefile fi } -# @FUNCTION: kernel-2_src_prepare -# @USAGE: -# @DESCRIPTION: -# Apply any user patches - -kernel-2_src_prepare() { - - debug-print "Applying any user patches" - - # apply any user patches - case ${EAPI:-0} in - 0|1|2|3|4|5) epatch_user ;; - 6) eapply_user ;; - esac -} - # @FUNCTION: kernel-2_src_compile # @USAGE: # @DESCRIPTION: