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 23516138CCF for ; Sun, 24 May 2015 00:08:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A1E3E0921; Sun, 24 May 2015 00:08:37 +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 B1736E0924 for ; Sun, 24 May 2015 00:08:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 78BBE3409ED for ; Sun, 24 May 2015 00:08:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2AAB2A07 for ; Sun, 24 May 2015 00:08:31 +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: <1425002584.fed3b45bb608d2022fbc253aff836397c5801cb7.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/kmerge.sh X-VCS-Directories: targets/support/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: fed3b45bb608d2022fbc253aff836397c5801cb7 X-VCS-Branch: master Date: Sun, 24 May 2015 00:08:31 +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: 9fabcdf8-6e22-493c-99d3-ceaa42f5e577 X-Archives-Hash: 65c2deed2448e203d107d7bc0db5113d commit: fed3b45bb608d2022fbc253aff836397c5801cb7 Author: Guy Martin gentoo org> AuthorDate: Wed Feb 5 10:40:03 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Fri Feb 27 02:03:04 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=fed3b45b 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 | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index 100c6ef..03869c3 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -197,9 +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 --update --newuse" run_merge "${clst_ksource}" || exit 1 - KERNELVERSION=`portageq best_visible / "${clst_ksource}"` - if [ ! -e /etc/portage/profile/package.provided ] + + 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 /etc/portage/profile echo "${KERNELVERSION}" > /etc/portage/profile/package.provided @@ -209,8 +217,26 @@ then echo "${KERNELVERSION}" >> /etc/portage/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 +285,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" /etc/portage/profile/package.provided - fi fi 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 E1E58138CD0 for ; Thu, 21 May 2015 23:53:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7CAD2E091C; Thu, 21 May 2015 23:53:40 +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 017BAE091C for ; Thu, 21 May 2015 23:53:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D16D341001 for ; Thu, 21 May 2015 23:53:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B84A2A03 for ; Thu, 21 May 2015 23:53:30 +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: <1425002584.fed3b45bb608d2022fbc253aff836397c5801cb7.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/kmerge.sh X-VCS-Directories: targets/support/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: fed3b45bb608d2022fbc253aff836397c5801cb7 X-VCS-Branch: pending Date: Thu, 21 May 2015 23:53:30 +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: 4ade6a79-3d98-4c16-9637-785f6db7d9e2 X-Archives-Hash: c57fd2136483b9447178194a38bb41a4 Message-ID: <20150521235330.PKl8ZLJHBbEYHnk6vHT1NbAPRDbYdyYUrdEHUMjiwiQ@z> commit: fed3b45bb608d2022fbc253aff836397c5801cb7 Author: Guy Martin gentoo org> AuthorDate: Wed Feb 5 10:40:03 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Fri Feb 27 02:03:04 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=fed3b45b 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 | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index 100c6ef..03869c3 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -197,9 +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 --update --newuse" run_merge "${clst_ksource}" || exit 1 - KERNELVERSION=`portageq best_visible / "${clst_ksource}"` - if [ ! -e /etc/portage/profile/package.provided ] + + 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 /etc/portage/profile echo "${KERNELVERSION}" > /etc/portage/profile/package.provided @@ -209,8 +217,26 @@ then echo "${KERNELVERSION}" >> /etc/portage/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 +285,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" /etc/portage/profile/package.provided - fi fi