1 |
clst_* prefixed variables are created by setup_environment(), which |
2 |
these variables are not. |
3 |
|
4 |
Signed-off-by: Matt Turner <mattst88@g.o> |
5 |
--- |
6 |
targets/embedded/controller.sh | 2 +- |
7 |
targets/livecd-stage2/controller.sh | 4 +- |
8 |
targets/netboot/controller.sh | 4 +- |
9 |
targets/stage4/controller.sh | 4 +- |
10 |
targets/support/bootloader-setup.sh | 6 +- |
11 |
targets/support/kmerge.sh | 112 ++++++++++++++-------------- |
12 |
6 files changed, 66 insertions(+), 66 deletions(-) |
13 |
|
14 |
diff --git a/targets/embedded/controller.sh b/targets/embedded/controller.sh |
15 |
index e40a913f..d0bf331d 100755 |
16 |
--- a/targets/embedded/controller.sh |
17 |
+++ b/targets/embedded/controller.sh |
18 |
@@ -40,7 +40,7 @@ case ${1} in |
19 |
|
20 |
kernel) |
21 |
shift |
22 |
- export clst_kname="${1}" |
23 |
+ export kname="${1}" |
24 |
|
25 |
[ -n "${clst_linuxrc}" ] && \ |
26 |
copy_to_chroot ${clst_linuxrc} /tmp/linuxrc |
27 |
diff --git a/targets/livecd-stage2/controller.sh b/targets/livecd-stage2/controller.sh |
28 |
index 0701a26b..566571e6 100755 |
29 |
--- a/targets/livecd-stage2/controller.sh |
30 |
+++ b/targets/livecd-stage2/controller.sh |
31 |
@@ -15,14 +15,14 @@ case $1 in |
32 |
|
33 |
kernel) |
34 |
shift |
35 |
- export clst_kname="$1" |
36 |
+ export kname="$1" |
37 |
|
38 |
[ -n "${clst_linuxrc}" ] && \ |
39 |
copy_to_chroot ${clst_linuxrc} /tmp/linuxrc |
40 |
exec_in_chroot ${clst_shdir}/support/kmerge.sh |
41 |
delete_from_chroot /tmp/linuxrc |
42 |
|
43 |
- extract_modules ${clst_chroot_path} ${clst_kname} |
44 |
+ extract_modules ${clst_chroot_path} ${kname} |
45 |
#16:12 <@solar> kernel_name=foo |
46 |
#16:13 <@solar> eval clst_boot_kernel_${kernel_name}_config=bar |
47 |
#16:13 <@solar> eval echo \$clst_boot_kernel_${kernel_name}_config |
48 |
diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh |
49 |
index f84a32bd..e6fc9d2b 100755 |
50 |
--- a/targets/netboot/controller.sh |
51 |
+++ b/targets/netboot/controller.sh |
52 |
@@ -24,7 +24,7 @@ case ${1} in |
53 |
|
54 |
kernel) |
55 |
shift |
56 |
- export clst_kname="$1" |
57 |
+ export kname="$1" |
58 |
|
59 |
[ -n "${clst_linuxrc}" ] && \ |
60 |
copy_to_chroot ${clst_linuxrc} /tmp/linuxrc |
61 |
@@ -36,7 +36,7 @@ case ${1} in |
62 |
delete_from_chroot /tmp/linuxrc |
63 |
delete_from_chroot /tmp/busy-config |
64 |
|
65 |
- extract_modules ${clst_chroot_path} ${clst_kname} |
66 |
+ extract_modules ${clst_chroot_path} ${kname} |
67 |
#16:12 <@solar> kernel_name=foo |
68 |
#16:13 <@solar> eval clst_boot_kernel_${kernel_name}_config=bar |
69 |
#16:13 <@solar> eval echo \$clst_boot_kernel_${kernel_name}_config |
70 |
diff --git a/targets/stage4/controller.sh b/targets/stage4/controller.sh |
71 |
index 7ca3e9bc..7825f800 100755 |
72 |
--- a/targets/stage4/controller.sh |
73 |
+++ b/targets/stage4/controller.sh |
74 |
@@ -21,7 +21,7 @@ case $1 in |
75 |
|
76 |
kernel) |
77 |
shift |
78 |
- export clst_kname="$1" |
79 |
+ export kname="$1" |
80 |
|
81 |
# If we have our own linuxrc, copy it in |
82 |
[ -n "${clst_linuxrc}" ] && \ |
83 |
@@ -29,7 +29,7 @@ case $1 in |
84 |
exec_in_chroot ${clst_shdir}/support/kmerge.sh |
85 |
delete_from_chroot /tmp/linuxrc |
86 |
|
87 |
- extract_modules ${clst_chroot_path} ${clst_kname} |
88 |
+ extract_modules ${clst_chroot_path} ${kname} |
89 |
;; |
90 |
|
91 |
build_packages) |
92 |
diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh |
93 |
index 0643a04c..a82b69dc 100755 |
94 |
--- a/targets/support/bootloader-setup.sh |
95 |
+++ b/targets/support/bootloader-setup.sh |
96 |
@@ -102,7 +102,7 @@ case ${clst_hostarch} in |
97 |
echo '' >> ${iacfg} |
98 |
for x in ${clst_boot_kernel} |
99 |
do |
100 |
- eval "clst_kernel_console=\$clst_boot_kernel_${x}_console" |
101 |
+ eval "kernel_console=\$clst_boot_kernel_${x}_console" |
102 |
eval custom_kopts=\$${x}_kernelopts |
103 |
|
104 |
echo "menuentry 'Boot LiveCD (kernel: ${x})' --class gnu-linux --class os {" >> ${iacfg} |
105 |
@@ -114,10 +114,10 @@ case ${clst_hostarch} in |
106 |
echo " linux ${kern_subdir}/${x} ${default_append_line[@]} docache" >> ${iacfg} |
107 |
echo " initrd ${kern_subdir}/${x}.igz" >> ${iacfg} |
108 |
echo "}" >> ${iacfg} |
109 |
- if [ -n "${clst_kernel_console}" ] |
110 |
+ if [ -n "${kernel_console}" ] |
111 |
then |
112 |
echo "submenu 'Special console options (kernel: ${x})' --class gnu-linux --class os {" >> ${iacfg} |
113 |
- for y in ${clst_kernel_console} |
114 |
+ for y in ${kernel_console} |
115 |
do |
116 |
echo "menuentry 'Boot LiveCD (kernel: ${x} console=${y})' --class gnu-linux --class os {" >> ${iacfg} |
117 |
echo " linux ${kern_subdir}/${x} ${default_append_line[@]} console=${y}" >> ${iacfg} |
118 |
diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh |
119 |
index 0e72e98b..15a21b90 100755 |
120 |
--- a/targets/support/kmerge.sh |
121 |
+++ b/targets/support/kmerge.sh |
122 |
@@ -3,17 +3,17 @@ |
123 |
source /tmp/chroot-functions.sh |
124 |
|
125 |
install -d /tmp/kerncache |
126 |
-PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds |
127 |
+PKGDIR=/tmp/kerncache/${kname}/ebuilds |
128 |
|
129 |
setup_gk_args() { |
130 |
# default genkernel args |
131 |
GK_ARGS=( |
132 |
- "${clst_kernel_gk_kernargs[@]}" |
133 |
- --cachedir=/tmp/kerncache/${clst_kname}-genkernel_cache-${clst_version_stamp} |
134 |
+ "${kernel_gk_kernargs[@]}" |
135 |
+ --cachedir=/tmp/kerncache/${kname}-genkernel_cache-${clst_version_stamp} |
136 |
--no-mountboot |
137 |
--kerneldir=/usr/src/linux |
138 |
- --modulespackage=/tmp/kerncache/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 |
139 |
- --minkernpackage=/tmp/kerncache/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all |
140 |
+ --modulespackage=/tmp/kerncache/${kname}-modules-${clst_version_stamp}.tar.bz2 |
141 |
+ --minkernpackage=/tmp/kerncache/${kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all |
142 |
) |
143 |
# extra genkernel options that we have to test for |
144 |
if [ -n "${clst_gk_mainargs}" ] |
145 |
@@ -22,16 +22,16 @@ setup_gk_args() { |
146 |
fi |
147 |
if [ -n "${clst_KERNCACHE}" ] |
148 |
then |
149 |
- GK_ARGS+=(--kerncache=/tmp/kerncache/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2) |
150 |
+ GK_ARGS+=(--kerncache=/tmp/kerncache/${kname}-kerncache-${clst_version_stamp}.tar.bz2) |
151 |
fi |
152 |
- if [ -e /var/tmp/${clst_kname}.config ] |
153 |
+ if [ -e /var/tmp/${kname}.config ] |
154 |
then |
155 |
- GK_ARGS+=(--kernel-config=/var/tmp/${clst_kname}.config) |
156 |
+ GK_ARGS+=(--kernel-config=/var/tmp/${kname}.config) |
157 |
fi |
158 |
|
159 |
- if [ -d "/tmp/initramfs_overlay/${clst_initramfs_overlay}" ] |
160 |
+ if [ -d "/tmp/initramfs_overlay/${initramfs_overlay}" ] |
161 |
then |
162 |
- GK_ARGS+=(--initramfs-overlay=/tmp/initramfs_overlay/${clst_initramfs_overlay}) |
163 |
+ GK_ARGS+=(--initramfs-overlay=/tmp/initramfs_overlay/${initramfs_overlay}) |
164 |
fi |
165 |
if [ -n "${clst_CCACHE}" ] |
166 |
then |
167 |
@@ -70,10 +70,10 @@ genkernel_compile(){ |
168 |
# Build our list of kernel packages |
169 |
case ${clst_livecd_type} in |
170 |
gentoo-release-live*) |
171 |
- if [ -n "${clst_kernel_merge}" ] |
172 |
+ if [ -n "${kernel_merge}" ] |
173 |
then |
174 |
mkdir -p /usr/livecd |
175 |
- echo "${clst_kernel_merge}" > /usr/livecd/kernelpkgs.txt |
176 |
+ echo "${kernel_merge}" > /usr/livecd/kernelpkgs.txt |
177 |
fi |
178 |
;; |
179 |
esac |
180 |
@@ -94,17 +94,17 @@ genkernel_compile(){ |
181 |
then |
182 |
gk_callback_opts+=(-f) |
183 |
fi |
184 |
- if [ "${clst_kernel_merge}" != "" ] |
185 |
+ if [ "${kernel_merge}" != "" ] |
186 |
then |
187 |
- genkernel --callback="emerge ${gk_callback_opts[@]} ${clst_kernel_merge}" \ |
188 |
+ genkernel --callback="emerge ${gk_callback_opts[@]} ${kernel_merge}" \ |
189 |
"${GK_ARGS[@]}" || exit 1 |
190 |
else |
191 |
genkernel "${GK_ARGS[@]}" || exit 1 |
192 |
fi |
193 |
- if [ -n "${clst_KERNCACHE}" -a -e /var/tmp/${clst_kname}.config ] |
194 |
+ if [ -n "${clst_KERNCACHE}" -a -e /var/tmp/${kname}.config ] |
195 |
then |
196 |
- md5sum /var/tmp/${clst_kname}.config | awk '{print $1}' > \ |
197 |
- /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG |
198 |
+ md5sum /var/tmp/${kname}.config | awk '{print $1}' > \ |
199 |
+ /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.CONFIG |
200 |
fi |
201 |
} |
202 |
|
203 |
@@ -115,15 +115,15 @@ export CONFIG_PROTECT="-*" |
204 |
rm /etc/localtime |
205 |
cp -f /usr/share/zoneinfo/UTC /etc/localtime |
206 |
|
207 |
-eval "clst_initramfs_overlay=\$clst_boot_kernel_${kname}_initramfs_overlay" |
208 |
-eval "clst_kernel_merge=\$clst_boot_kernel_${kname}_packages" |
209 |
-eval "clst_kernel_use=\$clst_boot_kernel_${kname}_use" |
210 |
-eval eval clst_kernel_gk_kernargs=( \$clst_boot_kernel_${kname}_gk_kernargs ) |
211 |
-eval "clst_ksource=\$clst_boot_kernel_${kname}_sources" |
212 |
+eval "initramfs_overlay=\$clst_boot_kernel_${kname}_initramfs_overlay" |
213 |
+eval "kernel_merge=\$clst_boot_kernel_${kname}_packages" |
214 |
+eval "kernel_use=\$clst_boot_kernel_${kname}_use" |
215 |
+eval eval kernel_gk_kernargs=( \$clst_boot_kernel_${kname}_gk_kernargs ) |
216 |
+eval "ksource=\$clst_boot_kernel_${kname}_sources" |
217 |
|
218 |
-if [ -z "${clst_ksource}" ] |
219 |
+if [ -z "${ksource}" ] |
220 |
then |
221 |
- clst_ksource="virtual/linux-sources" |
222 |
+ ksource="virtual/linux-sources" |
223 |
fi |
224 |
|
225 |
# Don't use pkgcache here, as the kernel source may get emerged with different |
226 |
@@ -137,25 +137,25 @@ if [ -n "${clst_KERNCACHE}" ] |
227 |
then |
228 |
|
229 |
USE_MATCH=0 |
230 |
- if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE ] |
231 |
+ if [ -e /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.USE ] |
232 |
then |
233 |
- STR1=$(for i in `cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE`; do echo $i; done|sort) |
234 |
- STR2=$(for i in ${clst_kernel_use}; do echo $i; done|sort) |
235 |
+ STR1=$(for i in `cat /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.USE`; do echo $i; done|sort) |
236 |
+ STR2=$(for i in ${kernel_use}; do echo $i; done|sort) |
237 |
if [ "${STR1}" = "${STR2}" ] |
238 |
then |
239 |
USE_MATCH=1 |
240 |
else |
241 |
- [ -d /tmp/kerncache/${clst_kname}/ebuilds ] && \ |
242 |
- rm -r /tmp/kerncache/${clst_kname}/ebuilds |
243 |
- [ -e /tmp/kerncache/${clst_kname}/usr/src/linux/.config ] && \ |
244 |
- rm /tmp/kerncache/${clst_kname}/usr/src/linux/.config |
245 |
+ [ -d /tmp/kerncache/${kname}/ebuilds ] && \ |
246 |
+ rm -r /tmp/kerncache/${kname}/ebuilds |
247 |
+ [ -e /tmp/kerncache/${kname}/usr/src/linux/.config ] && \ |
248 |
+ rm /tmp/kerncache/${kname}/usr/src/linux/.config |
249 |
fi |
250 |
fi |
251 |
|
252 |
EXTRAVERSION_MATCH=0 |
253 |
- if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION ] |
254 |
+ if [ -e /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.EXTRAVERSION ] |
255 |
then |
256 |
- STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION` |
257 |
+ STR1=`cat /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.EXTRAVERSION` |
258 |
STR2=${clst_kextraversion} |
259 |
if [ "${STR1}" = "${STR2}" ] |
260 |
then |
261 |
@@ -164,14 +164,14 @@ then |
262 |
fi |
263 |
|
264 |
CONFIG_MATCH=0 |
265 |
- if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG ] |
266 |
+ if [ -e /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.CONFIG ] |
267 |
then |
268 |
- if [ ! -e /var/tmp/${clst_kname}.config ] |
269 |
+ if [ ! -e /var/tmp/${kname}.config ] |
270 |
then |
271 |
CONFIG_MATCH=1 |
272 |
else |
273 |
- STR1=`cat /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG` |
274 |
- STR2=`md5sum /var/tmp/${clst_kname}.config|awk '{print $1}'` |
275 |
+ STR1=`cat /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.CONFIG` |
276 |
+ STR2=`md5sum /var/tmp/${kname}.config|awk '{print $1}'` |
277 |
if [ "${STR1}" = "${STR2}" ] |
278 |
then |
279 |
CONFIG_MATCH=1 |
280 |
@@ -181,14 +181,14 @@ then |
281 |
|
282 |
# install dependencies of kernel sources ahead of time in case |
283 |
# package.provided generated below causes them not to be (re)installed |
284 |
- PKGDIR=${PKGDIR} run_merge --onlydeps "${clst_ksource}" |
285 |
+ PKGDIR=${PKGDIR} run_merge --onlydeps "${ksource}" |
286 |
|
287 |
# Create the kerncache directory if it doesn't exists |
288 |
- mkdir -p /tmp/kerncache/${clst_kname} |
289 |
+ mkdir -p /tmp/kerncache/${kname} |
290 |
|
291 |
- if [ -e /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION ] |
292 |
+ if [ -e /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.KERNELVERSION ] |
293 |
then |
294 |
- KERNELVERSION=$(</tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION) |
295 |
+ KERNELVERSION=$(</tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.KERNELVERSION) |
296 |
mkdir -p ${clst_port_conf}/profile |
297 |
echo "${KERNELVERSION}" > ${clst_port_conf}/profile/package.provided |
298 |
else |
299 |
@@ -196,26 +196,26 @@ then |
300 |
fi |
301 |
|
302 |
# Don't use package.provided if there's a pending up/downgrade |
303 |
- if [[ "$(portageq best_visible / ${clst_ksource})" == "${KERNELVERSION}" ]]; then |
304 |
- echo "No pending updates for ${clst_ksource}" |
305 |
+ if [[ "$(portageq best_visible / ${ksource})" == "${KERNELVERSION}" ]]; then |
306 |
+ echo "No pending updates for ${ksource}" |
307 |
else |
308 |
- echo "Pending updates for ${clst_ksource}, removing package.provided" |
309 |
+ echo "Pending updates for ${ksource}, removing package.provided" |
310 |
rm -f ${clst_port_conf}/profile/package.provided |
311 |
fi |
312 |
|
313 |
[ -L /usr/src/linux ] && rm -f /usr/src/linux |
314 |
|
315 |
- PKGDIR=${PKGDIR} run_merge "${clst_ksource}" |
316 |
+ PKGDIR=${PKGDIR} run_merge "${ksource}" |
317 |
|
318 |
- SOURCESDIR="/tmp/kerncache/${clst_kname}/sources" |
319 |
+ SOURCESDIR="/tmp/kerncache/${kname}/sources" |
320 |
if [ -L /usr/src/linux ] |
321 |
then |
322 |
|
323 |
# A kernel was merged, move it to $SOURCESDIR |
324 |
[ -e ${SOURCESDIR} ] && rm -Rf ${SOURCESDIR} |
325 |
|
326 |
- KERNELVERSION=`portageq best_visible / "${clst_ksource}"` |
327 |
- echo "${KERNELVERSION}" > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.KERNELVERSION |
328 |
+ KERNELVERSION=`portageq best_visible / "${ksource}"` |
329 |
+ echo "${KERNELVERSION}" > /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.KERNELVERSION |
330 |
|
331 |
echo "Moving kernel sources to ${SOURCESDIR} ..." |
332 |
mv `readlink -f /usr/src/linux` ${SOURCESDIR} |
333 |
@@ -231,18 +231,18 @@ then |
334 |
then |
335 |
echo "Setting extraversion to ${clst_kextraversion}" |
336 |
sed -i -e "s:EXTRAVERSION \(=.*\):EXTRAVERSION \1-${clst_kextraversion}:" /usr/src/linux/Makefile |
337 |
- echo ${clst_kextraversion} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION |
338 |
+ echo ${clst_kextraversion} > /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.EXTRAVERSION |
339 |
else |
340 |
- touch /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.EXTRAVERSION |
341 |
+ touch /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.EXTRAVERSION |
342 |
fi |
343 |
fi |
344 |
|
345 |
else |
346 |
- run_merge "${clst_ksource}" |
347 |
+ run_merge "${ksource}" |
348 |
#ensure that there is a /usr/src/linux symlink and it points to the sources we just installed |
349 |
echo "Adjusting /usr/src/linux to point to \ |
350 |
-$(portageq contents / $(portageq best_visible / "${clst_ksource}" 2>/dev/null) 2>/dev/null | grep --color=never '/usr/src/' | head -n1 2>/dev/null)" |
351 |
- ln -snf $(portageq contents / $(portageq best_visible / "${clst_ksource}" 2>/dev/null) 2>/dev/null | grep --color=never '/usr/src/' | head -n1 2>/dev/null) \ |
352 |
+$(portageq contents / $(portageq best_visible / "${ksource}" 2>/dev/null) 2>/dev/null | grep --color=never '/usr/src/' | head -n1 2>/dev/null)" |
353 |
+ ln -snf $(portageq contents / $(portageq best_visible / "${ksource}" 2>/dev/null) 2>/dev/null | grep --color=never '/usr/src/' | head -n1 2>/dev/null) \ |
354 |
/usr/src/linux |
355 |
if [ ! "${clst_kextraversion}" = "" ] |
356 |
then |
357 |
@@ -254,14 +254,14 @@ fi |
358 |
|
359 |
# Update USE flag in make.conf |
360 |
[ -e ${clst_make_conf} ] && \ |
361 |
- echo "USE=\"\${USE} ${clst_kernel_use} build\"" >> ${clst_make_conf} |
362 |
+ echo "USE=\"\${USE} ${kernel_use} build\"" >> ${clst_make_conf} |
363 |
|
364 |
make_destpath |
365 |
|
366 |
|
367 |
genkernel_compile |
368 |
|
369 |
-sed -i "/USE=\"\${USE} ${clst_kernel_use} \"/d" ${clst_make_conf} |
370 |
+sed -i "/USE=\"\${USE} ${kernel_use} \"/d" ${clst_make_conf} |
371 |
# grep out the kernel version so that we can do our modules magic |
372 |
VER=`grep ^VERSION\ \= /usr/src/linux/Makefile | awk '{ print $3 };'` |
373 |
PAT=`grep ^PATCHLEVEL\ \= /usr/src/linux/Makefile | awk '{ print $3 };'` |
374 |
@@ -274,5 +274,5 @@ unset USE |
375 |
|
376 |
if [ -n "${clst_KERNCACHE}" ] |
377 |
then |
378 |
- echo ${clst_kernel_use} > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.USE |
379 |
+ echo ${kernel_use} > /tmp/kerncache/${kname}/${kname}-${clst_version_stamp}.USE |
380 |
fi |
381 |
-- |
382 |
2.26.2 |