public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:2.X commit in: targets/support/
Date: Mon, 24 Mar 2014 16:08:01 +0000 (UTC)	[thread overview]
Message-ID: <1395677227.63e36535a830364948a3ee258e7ab1e13905d6da.dol-sen@gentoo> (raw)

commit:     63e36535a830364948a3ee258e7ab1e13905d6da
Author:     Guy Martin <gmsoft <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  5 10:39:59 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Mar 24 16:07:07 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=63e36535

Fix merging kernel without kerncache enabled.

This is the proper fix for building kernels without kerncache.
It prevents the creation of kerncache specific files and does not check for them.
Build with kerncache require the later patch to work.

Conflicts:
	targets/support/kmerge.sh

---
 targets/support/kmerge.sh | 109 +++++++++++++++++++++++++---------------------
 1 file changed, 59 insertions(+), 50 deletions(-)

diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index 8e832e1..fac6e9c 100644
--- a/targets/support/kmerge.sh
+++ b/targets/support/kmerge.sh
@@ -109,7 +109,7 @@ genkernel_compile(){
 	else
 		genkernel ${GK_ARGS} || exit 1
 	fi
-	if [ -e /var/tmp/${clst_kname}.config ]
+	if [ -n "${clst_KERNCACHE}" -a -e /var/tmp/${clst_kname}.config ]
 	then
 		md5sum /var/tmp/${clst_kname}.config | awk '{print $1}' > \
 			/tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
@@ -144,63 +144,58 @@ fi
 # USE variables (and thus different patches enabled/disabled.) Also, there's no
 # real benefit in using the pkgcache for kernel source ebuilds.
 
-USE_MATCH=0
-if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
+
+# Check if we have a match in kerncach
+
+if [ -n "${clst_KERNCACHE}" ]
 then
-	STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
-	STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
-	if [ "${STR1}" = "${STR2}" ]
+
+	USE_MATCH=0
+	if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
 	then
-		#echo "USE Flags match"
-		USE_MATCH=1
-	else
-		if [ -n "${clst_KERNCACHE}" ]
+		STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
+		STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
+		if [ "${STR1}" = "${STR2}" ]
 		then
-		[ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \
-			rm -r /tmp/kerncache/${clst_kname}/ebuilds
-		[ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \
-			rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config
+			#echo "USE Flags match"
+			USE_MATCH=1
+		else
+			[ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \
+				rm -r /tmp/kerncache/${clst_kname}/ebuilds
+			[ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \
+				rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config
 		fi
 	fi
-fi
 
-EXTRAVERSION_MATCH=0
-if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
-then
-	STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
-	STR2=${clst_kextraversion}
-	if [ "${STR1}" = "${STR2}" ]
+	EXTRAVERSION_MATCH=0
+	if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
 	then
-		if [ -n "${clst_KERNCACHE}" ]
+		STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
+		STR2=${clst_kextraversion}
+		if [ "${STR1}" = "${STR2}" ]
 		then
 			#echo "EXTRAVERSION match"
 			EXTRAVERSION_MATCH=1
 		fi
 	fi
-fi
 
-CONFIG_MATCH=0
-if [ -n "${clst_KERNCACHE}" -a \
-     -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
-then
-	if [ ! -e /var/tmp/${clst_kname}.config ]
+	CONFIG_MATCH=0
+	if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
 	then
-		CONFIG_MATCH=1
-	else
-		STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
-		STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
-		if [ "${STR1}" = "${STR2}" ]
+		if [ ! -e /var/tmp/${clst_kname}.config ]
 		then
 			CONFIG_MATCH=1
+		else
+			STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
+			STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
+			if [ "${STR1}" = "${STR2}" ]
+			then
+				CONFIG_MATCH=1
+			fi
 		fi
 	fi
-fi
 
-[ -e /etc/portage/make.conf ] && \
-	echo "USE=\"\${USE} ${clst_kernel_use} \"" >> /etc/portage/make.conf
-
-if [ -n "${clst_KERNCACHE}" ]
-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}"`
@@ -216,26 +211,39 @@ then
 	fi
 	[ -L /usr/src/linux ] && rm -f /usr/src/linux
 	ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
+
+	# If catalyst has set to a empty string, extraversion wasn't specified so we
+	# skip this part
+	if [ "${EXTRAVERSION_MATCH}" = "0" ]
+	then
+		if [ ! "${clst_kextraversion}" = "" ]
+		then
+			echo "Setting extraversion to ${clst_kextraversion}"
+			sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
+			echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+		else
+			touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
+		fi
+	fi
+
 else
 	[ -L /usr/src/linux ] && rm -f /usr/src/linux
 	run_merge "${clst_ksource}" || exit 1
-fi
-make_destpath
-
-# If catalyst has set to a empty string, extraversion wasn't specified so we
-# skip this part
-if [ "${EXTRAVERSION_MATCH}" = "0" ]
-then
 	if [ ! "${clst_kextraversion}" = "" ]
 	then
 		echo "Setting extraversion to ${clst_kextraversion}"
 		sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
-		echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
-	else
-		touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
 	fi
 fi
 
+
+# Update USE flag in make.conf
+[ -e ${clst_make_conf} ] && \
+	echo "USE=\"\${USE} ${clst_kernel_use} build\"" >> ${clst_make_conf}
+
+make_destpath
+
+
 build_kernel
 sed -i "/USE=\"\${USE} ${clst_kernel_use} \"/d" /etc/portage/make.conf
 # grep out the kernel version so that we can do our modules magic
@@ -246,11 +254,12 @@ EXV=`grep ^EXTRAVERSION\ \= /usr/src/linux/Makefile | sed -e "s/EXTRAVERSION =//
 clst_fudgeuname=${VER}.${PAT}.${SUB}${EXV}
 
 unset USE
-echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.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


             reply	other threads:[~2014-03-24 16:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 16:08 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-04  2:42 [gentoo-commits] proj/catalyst:2.X commit in: targets/support/ Anthony G. Basile
2018-03-04  2:01 Anthony G. Basile
2017-10-12 19:41 Robin H. Johnson
2016-04-08 21:51 Anthony G. Basile
2016-03-04  1:51 Anthony G. Basile
2014-12-24 14:42 Raúl Porcel
2014-12-07 23:52 Brian Dolbec
2014-11-28 11:41 Raúl Porcel
2014-10-26 12:25 Raúl Porcel
2014-09-11 19:14 Brian Dolbec
2014-09-11  2:23 Brian Dolbec
2014-09-11  2:23 Brian Dolbec
2014-05-16 19:15 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395677227.63e36535a830364948a3ee258e7ab1e13905d6da.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox