From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 09/17] Fix and improve kernel build when kerncache is enabled.
Date: Sat, 22 Mar 2014 10:03:07 -0700 [thread overview]
Message-ID: <1395507795-13754-10-git-send-email-dolsen@gentoo.org> (raw)
In-Reply-To: <1395507795-13754-1-git-send-email-dolsen@gentoo.org>
From: Guy Martin <gmsoft@gentoo.org>
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
---
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 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
--
1.8.5.3
next prev parent reply other threads:[~2014-03-22 17:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-22 17:02 [gentoo-catalyst] 2.X bugfixes Brian Dolbec
2014-03-22 17:02 ` [gentoo-catalyst] [PATCH 01/17] livecdfs-update: No tmpfs on /lib/firmware Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 02/17] update-modules doesn't exists anymore Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 03/17] depscan.sh " Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 04/17] /etc/conf.d/rc " Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 05/17] Fix merging kernel without kerncache enabled Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 06/17] Rename System.map in a way that it won't be matched if multiple kernel are used Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 07/17] Allow kernelopts as a valid value for kernels Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 08/17] Make use of _kernelopts for hppa Brian Dolbec
2014-03-22 17:03 ` Brian Dolbec [this message]
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 10/17] Don't make cdtar mandatory Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 11/17] Use the system's iplboot to be sure it matches palo's version Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 12/17] Remove unused hppa cdtar Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 13/17] chmod +x all sh scripts so they can run from the git checkout Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 14/17] chmod +x targets/stage1/build.py Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 15/17] Add more working files, directories to .gitignore Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 16/17] Fix undefined variable: RLIMIT_NOFILE Brian Dolbec
2014-03-22 17:03 ` [gentoo-catalyst] [PATCH 17/17] Fix a relative path bug Brian Dolbec
2014-04-02 20:12 ` [gentoo-catalyst] 2.X bugfixes Brian Dolbec
2014-04-02 20:32 ` Rick "Zero_Chaos" Farina
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=1395507795-13754-10-git-send-email-dolsen@gentoo.org \
--to=dolsen@gentoo.org \
--cc=gentoo-catalyst@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