aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Martin <gmsoft@gentoo.org>2014-02-05 11:40:03 +0100
committerBrian Dolbec <dolsen@gentoo.org>2014-03-24 09:07:07 -0700
commit0b579e881548e7e5d2fac8b47a36f8d513053c76 (patch)
tree272eb800f01a4c0e96e2471e6ca2e49f5e75cf35
parentMake use of _kernelopts for hppa. (diff)
downloadcatalyst-0b579e881548e7e5d2fac8b47a36f8d513053c76.tar.gz
catalyst-0b579e881548e7e5d2fac8b47a36f8d513053c76.tar.bz2
catalyst-0b579e881548e7e5d2fac8b47a36f8d513053c76.zip
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. Conflicts: targets/support/kmerge.sh
-rw-r--r--targets/support/kmerge.sh38
1 files changed, 30 insertions, 8 deletions
diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index fac6e9c..c1b6a35 100644
--- 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 --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=$(</tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION)
+ mkdir -p /etc/portage/profile
+ echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
+ else
+ rm -f /etc/portage/profile/package.provided
+ fi
+
if [ ! -e /etc/portage/profile/package.provided ]
then
mkdir -p /etc/portage/profile
@@ -209,8 +218,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 +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 /etc/portage/profile/package.provided ]
- then
- sed -i "/^$(echo "${KERNELVERSION}" | sed -e 's|/|\\/|g')\$/d" /etc/portage/profile/package.provided
- fi
fi