From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C84D8138E20 for ; Wed, 19 Feb 2014 17:47:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 989E5E0B9A; Wed, 19 Feb 2014 17:47:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E1307E0B9A for ; Wed, 19 Feb 2014 17:47:52 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3BBC433FAFF for ; Wed, 19 Feb 2014 17:47:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 6F07D188CD for ; Wed, 19 Feb 2014 17:47:48 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1392831715.84cc9e2cdcea063e2d6bd8bb8489df9f4a380353.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:3.0 commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/kmerge.sh X-VCS-Directories: targets/support/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 84cc9e2cdcea063e2d6bd8bb8489df9f4a380353 X-VCS-Branch: 3.0 Date: Wed, 19 Feb 2014 17:47:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 89cdb90c-e99c-45f1-adeb-5f65d6cb11ae X-Archives-Hash: ab994fa44425b3f3fee73e324fc3db17 commit: 84cc9e2cdcea063e2d6bd8bb8489df9f4a380353 Author: Guy Martin gentoo org> AuthorDate: Wed Feb 5 10:40:03 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Feb 19 17:41:55 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=84cc9e2c Fix and improve kernel build when kerncache is enabled. This patch gets rid of setting ROOT for merging kernel sources. Instead, the sources are moved manually to the kerncache directory. A new file is created containing the kernel version and it is fed into package.provided to prevent merging the kernel sources again. Brian Dolbec: fix whitespace error. --- targets/support/kmerge.sh | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index 7c7f8fe..5d1c674 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -197,8 +197,17 @@ then # Create the kerncache directory if it doesn't exists mkdir -p /tmp/kerncache/${clst_kname} - clst_root_path=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --nodeps --update --newuse" run_merge "${clst_ksource}" || exit 1 - KERNELVERSION=`portageq best_visible / "${clst_ksource}"` + + + if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION ] + then + KERNELVERSION=$( ${clst_port_conf}/profile/package.provided + else + rm -f ${clst_port_conf}/profile/package.provided + fi + if [ ! -e ${clst_port_conf}/profile/package.provided ] then mkdir -p ${clst_port_conf}/profile @@ -209,8 +218,26 @@ then echo "${KERNELVERSION}" >> ${clst_port_conf}/profile/package.provided fi fi + [ -L /usr/src/linux ] && rm -f /usr/src/linux - ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux + + PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --nodeps --update --newuse" run_merge "${clst_ksource}" || exit 1 + + SOURCESDIR="/tmp/kerncache/${clst_kname}/sources" + if [ -L /usr/src/linux ] + then + + # A kernel was merged, move it to $SOURCESDIR + [ -e ${SOURCESDIR} ] && rm -Rf ${SOURCESDIR} + + KERNELVERSION=`portageq best_visible / "${clst_ksource}"` + echo "${KERNELVERSION}" > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION + + echo "Moving kernel sources to ${SOURCESDIR} ..." + mv `readlink -f /usr/src/linux` ${SOURCESDIR} + + fi + ln -sf ${SOURCESDIR} /usr/src/linux # If catalyst has set to a empty string, extraversion wasn't specified so we # skip this part @@ -259,9 +286,4 @@ unset USE if [ -n "${clst_KERNCACHE}" ] then echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE - - if [ -e ${clst_port_conf}/profile/package.provided ] - then - sed -i "/^$(echo "${KERNELVERSION}" | sed -e 's|/|\\/|g')\$/d" ${clst_port_conf}/profile/package.provided - fi fi