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:05
Message-Id: 1395677227.63e36535a830364948a3ee258e7ab1e13905d6da.dol-sen@gentoo
1 commit: 63e36535a830364948a3ee258e7ab1e13905d6da
2 Author: Guy Martin <gmsoft <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 5 10:39:59 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=63e36535
7
8 Fix merging kernel without kerncache enabled.
9
10 This is the proper fix for building kernels without kerncache.
11 It prevents the creation of kerncache specific files and does not check for them.
12 Build with kerncache require the later patch to work.
13
14 Conflicts:
15 targets/support/kmerge.sh
16
17 ---
18 targets/support/kmerge.sh | 109 +++++++++++++++++++++++++---------------------
19 1 file changed, 59 insertions(+), 50 deletions(-)
20
21 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
22 index 8e832e1..fac6e9c 100644
23 --- a/targets/support/kmerge.sh
24 +++ b/targets/support/kmerge.sh
25 @@ -109,7 +109,7 @@ genkernel_compile(){
26 else
27 genkernel ${GK_ARGS} || exit 1
28 fi
29 - if [ -e /var/tmp/${clst_kname}.config ]
30 + if [ -n "${clst_KERNCACHE}" -a -e /var/tmp/${clst_kname}.config ]
31 then
32 md5sum /var/tmp/${clst_kname}.config | awk '{print $1}' > \
33 /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
34 @@ -144,63 +144,58 @@ fi
35 # USE variables (and thus different patches enabled/disabled.) Also, there's no
36 # real benefit in using the pkgcache for kernel source ebuilds.
37
38 -USE_MATCH=0
39 -if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
40 +
41 +# Check if we have a match in kerncach
42 +
43 +if [ -n "${clst_KERNCACHE}" ]
44 then
45 - STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
46 - STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
47 - if [ "${STR1}" = "${STR2}" ]
48 +
49 + USE_MATCH=0
50 + if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ]
51 then
52 - #echo "USE Flags match"
53 - USE_MATCH=1
54 - else
55 - if [ -n "${clst_KERNCACHE}" ]
56 + STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort)
57 + STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort)
58 + if [ "${STR1}" = "${STR2}" ]
59 then
60 - [ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \
61 - rm -r /tmp/kerncache/${clst_kname}/ebuilds
62 - [ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \
63 - rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config
64 + #echo "USE Flags match"
65 + USE_MATCH=1
66 + else
67 + [ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \
68 + rm -r /tmp/kerncache/${clst_kname}/ebuilds
69 + [ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \
70 + rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config
71 fi
72 fi
73 -fi
74
75 -EXTRAVERSION_MATCH=0
76 -if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
77 -then
78 - STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
79 - STR2=${clst_kextraversion}
80 - if [ "${STR1}" = "${STR2}" ]
81 + EXTRAVERSION_MATCH=0
82 + if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ]
83 then
84 - if [ -n "${clst_KERNCACHE}" ]
85 + STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION`
86 + STR2=${clst_kextraversion}
87 + if [ "${STR1}" = "${STR2}" ]
88 then
89 #echo "EXTRAVERSION match"
90 EXTRAVERSION_MATCH=1
91 fi
92 fi
93 -fi
94
95 -CONFIG_MATCH=0
96 -if [ -n "${clst_KERNCACHE}" -a \
97 - -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
98 -then
99 - if [ ! -e /var/tmp/${clst_kname}.config ]
100 + CONFIG_MATCH=0
101 + if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ]
102 then
103 - CONFIG_MATCH=1
104 - else
105 - STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
106 - STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
107 - if [ "${STR1}" = "${STR2}" ]
108 + if [ ! -e /var/tmp/${clst_kname}.config ]
109 then
110 CONFIG_MATCH=1
111 + else
112 + STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG`
113 + STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'`
114 + if [ "${STR1}" = "${STR2}" ]
115 + then
116 + CONFIG_MATCH=1
117 + fi
118 fi
119 fi
120 -fi
121
122 -[ -e /etc/portage/make.conf ] && \
123 - echo "USE=\"\${USE} ${clst_kernel_use} \"" >> /etc/portage/make.conf
124 -
125 -if [ -n "${clst_KERNCACHE}" ]
126 -then
127 + # Create the kerncache directory if it doesn't exists
128 mkdir -p /tmp/kerncache/${clst_kname}
129 clst_root_path=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update --newuse" run_merge "${clst_ksource}" || exit 1
130 KERNELVERSION=`portageq best_visible / "${clst_ksource}"`
131 @@ -216,26 +211,39 @@ then
132 fi
133 [ -L /usr/src/linux ] && rm -f /usr/src/linux
134 ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
135 +
136 + # If catalyst has set to a empty string, extraversion wasn't specified so we
137 + # skip this part
138 + if [ "${EXTRAVERSION_MATCH}" = "0" ]
139 + then
140 + if [ ! "${clst_kextraversion}" = "" ]
141 + then
142 + echo "Setting extraversion to ${clst_kextraversion}"
143 + sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
144 + echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
145 + else
146 + touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
147 + fi
148 + fi
149 +
150 else
151 [ -L /usr/src/linux ] && rm -f /usr/src/linux
152 run_merge "${clst_ksource}" || exit 1
153 -fi
154 -make_destpath
155 -
156 -# If catalyst has set to a empty string, extraversion wasn't specified so we
157 -# skip this part
158 -if [ "${EXTRAVERSION_MATCH}" = "0" ]
159 -then
160 if [ ! "${clst_kextraversion}" = "" ]
161 then
162 echo "Setting extraversion to ${clst_kextraversion}"
163 sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile
164 - echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
165 - else
166 - touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION
167 fi
168 fi
169
170 +
171 +# Update USE flag in make.conf
172 +[ -e ${clst_make_conf} ] && \
173 + echo "USE=\"\${USE} ${clst_kernel_use} build\"" >> ${clst_make_conf}
174 +
175 +make_destpath
176 +
177 +
178 build_kernel
179 sed -i "/USE=\"\${USE} ${clst_kernel_use} \"/d" /etc/portage/make.conf
180 # grep out the kernel version so that we can do our modules magic
181 @@ -246,11 +254,12 @@ EXV=`grep ^EXTRAVERSION\ \= /usr/src/linux/Makefile | sed -e "s/EXTRAVERSION =//
182 clst_fudgeuname=${VER}.${PAT}.${SUB}${EXV}
183
184 unset USE
185 -echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE
186
187
188 if [ -n "${clst_KERNCACHE}" ]
189 then
190 + echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE
191 +
192 if [ -e /etc/portage/profile/package.provided ]
193 then
194 sed -i "/^$(echo "${KERNELVERSION}" | sed -e 's|/|\\/|g')\$/d" /etc/portage/profile/package.provided