Gentoo Archives: gentoo-catalyst

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