Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:2.X commit in: targets/support/
Date: Mon, 24 Mar 2014 16:08:09
Message-Id: 1395677227.0b579e881548e7e5d2fac8b47a36f8d513053c76.dol-sen@gentoo
1 commit: 0b579e881548e7e5d2fac8b47a36f8d513053c76
2 Author: Guy Martin <gmsoft <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 5 10:40:03 2014 +0000
4 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
5 CommitDate: Mon Mar 24 16:07:07 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=0b579e88
7
8 Fix and improve kernel build when kerncache is enabled.
9
10 This patch gets rid of setting ROOT for merging kernel sources. Instead, the
11 sources are moved manually to the kerncache directory. A new file is created
12 containing the kernel version and it is fed into package.provided to prevent
13 merging the kernel sources again.
14 Brian Dolbec: fix whitespace error.
15
16 Conflicts:
17 targets/support/kmerge.sh
18
19 ---
20 targets/support/kmerge.sh | 38 ++++++++++++++++++++++++++++++--------
21 1 file changed, 30 insertions(+), 8 deletions(-)
22
23 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
24 index fac6e9c..c1b6a35 100644
25 --- a/targets/support/kmerge.sh
26 +++ b/targets/support/kmerge.sh
27 @@ -197,8 +197,17 @@ then
28
29 # Create the kerncache directory if it doesn't exists
30 mkdir -p /tmp/kerncache/${clst_kname}
31 - clst_root_path=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update --newuse" run_merge "${clst_ksource}" || exit 1
32 - KERNELVERSION=`portageq best_visible / "${clst_ksource}"`
33 +
34 +
35 + if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION ]
36 + then
37 + KERNELVERSION=$(</tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION)
38 + mkdir -p /etc/portage/profile
39 + echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
40 + else
41 + rm -f /etc/portage/profile/package.provided
42 + fi
43 +
44 if [ ! -e /etc/portage/profile/package.provided ]
45 then
46 mkdir -p /etc/portage/profile
47 @@ -209,8 +218,26 @@ then
48 echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
49 fi
50 fi
51 +
52 [ -L /usr/src/linux ] && rm -f /usr/src/linux
53 - ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
54 +
55 + PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --nodeps --update --newuse" run_merge "${clst_ksource}" || exit 1
56 +
57 + SOURCESDIR="/tmp/kerncache/${clst_kname}/sources"
58 + if [ -L /usr/src/linux ]
59 + then
60 +
61 + # A kernel was merged, move it to $SOURCESDIR
62 + [ -e ${SOURCESDIR} ] && rm -Rf ${SOURCESDIR}
63 +
64 + KERNELVERSION=`portageq best_visible / "${clst_ksource}"`
65 + echo "${KERNELVERSION}" > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION
66 +
67 + echo "Moving kernel sources to ${SOURCESDIR} ..."
68 + mv `readlink -f /usr/src/linux` ${SOURCESDIR}
69 +
70 + fi
71 + ln -sf ${SOURCESDIR} /usr/src/linux
72
73 # If catalyst has set to a empty string, extraversion wasn't specified so we
74 # skip this part
75 @@ -259,9 +286,4 @@ unset USE
76 if [ -n "${clst_KERNCACHE}" ]
77 then
78 echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE
79 -
80 - if [ -e /etc/portage/profile/package.provided ]
81 - then
82 - sed -i "/^$(echo "${KERNELVERSION}" | sed -e 's|/|\\/|g')\$/d" /etc/portage/profile/package.provided
83 - fi
84 fi