1 |
commit: 8c58b6b1221a1b8d990a30dd8e2be18c5725ef76 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 14 05:33:15 2018 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 14 05:33:15 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8c58b6b1 |
7 |
|
8 |
kmerge.sh: Convert GK_ARGS to a bash array |
9 |
|
10 |
Cleaner in my opinion and is also necessary for the next patch. |
11 |
|
12 |
targets/support/kmerge.sh | 44 +++++++++++++++++++++++--------------------- |
13 |
1 file changed, 23 insertions(+), 21 deletions(-) |
14 |
|
15 |
diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh |
16 |
index dfdb637c..029b2a33 100755 |
17 |
--- a/targets/support/kmerge.sh |
18 |
+++ b/targets/support/kmerge.sh |
19 |
@@ -9,32 +9,34 @@ PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds |
20 |
|
21 |
setup_gk_args() { |
22 |
# default genkernel args |
23 |
- GK_ARGS="${clst_gk_mainargs} \ |
24 |
- ${clst_kernel_gk_kernargs} \ |
25 |
- --cachedir=/tmp/kerncache/${clst_kname}-genkernel_cache-${clst_version_stamp} \ |
26 |
- --no-mountboot \ |
27 |
- --kerneldir=/usr/src/linux \ |
28 |
- --modulespackage=/tmp/kerncache/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 \ |
29 |
- --minkernpackage=/tmp/kerncache/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all" |
30 |
+ GK_ARGS=( |
31 |
+ "${clst_gk_mainargs}" |
32 |
+ "${clst_kernel_gk_kernargs[@]}" |
33 |
+ --cachedir=/tmp/kerncache/${clst_kname}-genkernel_cache-${clst_version_stamp} |
34 |
+ --no-mountboot |
35 |
+ --kerneldir=/usr/src/linux |
36 |
+ --modulespackage=/tmp/kerncache/${clst_kname}-modules-${clst_version_stamp}.tar.bz2 |
37 |
+ --minkernpackage=/tmp/kerncache/${clst_kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all |
38 |
+ ) |
39 |
# extra genkernel options that we have to test for |
40 |
if [ -n "${clst_KERNCACHE}" ] |
41 |
then |
42 |
- GK_ARGS="${GK_ARGS} --kerncache=/tmp/kerncache/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2" |
43 |
+ GK_ARGS+=(--kerncache=/tmp/kerncache/${clst_kname}-kerncache-${clst_version_stamp}.tar.bz2) |
44 |
fi |
45 |
if [ -e /var/tmp/${clst_kname}.config ] |
46 |
then |
47 |
- GK_ARGS="${GK_ARGS} --kernel-config=/var/tmp/${clst_kname}.config" |
48 |
+ GK_ARGS+=(--kernel-config=/var/tmp/${clst_kname}.config) |
49 |
fi |
50 |
|
51 |
if [ -n "${clst_splash_theme}" ] |
52 |
then |
53 |
- GK_ARGS="${GK_ARGS} --splash=${clst_splash_theme}" |
54 |
+ GK_ARGS+=(--splash=${clst_splash_theme}) |
55 |
# Setup case structure for livecd_type |
56 |
case ${clst_livecd_type} in |
57 |
gentoo-release-minimal|gentoo-release-universal) |
58 |
case ${clst_hostarch} in |
59 |
amd64|x86) |
60 |
- GK_ARGS="${GK_ARGS} --splash-res=1024x768" |
61 |
+ GK_ARGS+=(--splash-res=1024x768) |
62 |
;; |
63 |
esac |
64 |
;; |
65 |
@@ -43,36 +45,36 @@ setup_gk_args() { |
66 |
|
67 |
if [ -d "/tmp/initramfs_overlay/${clst_initramfs_overlay}" ] |
68 |
then |
69 |
- GK_ARGS="${GK_ARGS} --initramfs-overlay=/tmp/initramfs_overlay/${clst_initramfs_overlay}" |
70 |
+ GK_ARGS+=(--initramfs-overlay=/tmp/initramfs_overlay/${clst_initramfs_overlay}) |
71 |
fi |
72 |
if [ -n "${clst_CCACHE}" ] |
73 |
then |
74 |
- GK_ARGS="${GK_ARGS} --kernel-cc=/usr/lib/ccache/bin/gcc --utils-cc=/usr/lib/ccache/bin/gcc" |
75 |
+ GK_ARGS+=(--kernel-cc=/usr/lib/ccache/bin/gcc --utils-cc=/usr/lib/ccache/bin/gcc) |
76 |
fi |
77 |
|
78 |
if [ -n "${clst_linuxrc}" ] |
79 |
then |
80 |
- GK_ARGS="${GK_ARGS} --linuxrc=/tmp/linuxrc" |
81 |
+ GK_ARGS+=(--linuxrc=/tmp/linuxrc) |
82 |
fi |
83 |
|
84 |
if [ -n "${clst_busybox_config}" ] |
85 |
then |
86 |
- GK_ARGS="${GK_ARGS} --busybox-config=/tmp/busy-config" |
87 |
+ GK_ARGS+=(--busybox-config=/tmp/busy-config) |
88 |
fi |
89 |
|
90 |
if [ "${clst_target}" == "netboot2" ] |
91 |
then |
92 |
- GK_ARGS="${GK_ARGS} --netboot" |
93 |
+ GK_ARGS+=(--netboot) |
94 |
|
95 |
if [ -n "${clst_merge_path}" ] |
96 |
then |
97 |
- GK_ARGS="${GK_ARGS} --initramfs-overlay=\"${clst_merge_path}\"" |
98 |
+ GK_ARGS+=(--initramfs-overlay="${clst_merge_path}") |
99 |
fi |
100 |
fi |
101 |
|
102 |
if [[ "${clst_VERBOSE}" == "true" ]] |
103 |
then |
104 |
- GK_ARGS="${GK_ARGS} --loglevel=2" |
105 |
+ GK_ARGS+=(--loglevel=2) |
106 |
fi |
107 |
} |
108 |
|
109 |
@@ -82,7 +84,7 @@ genkernel_compile(){ |
110 |
|
111 |
setup_gk_args |
112 |
#echo "The GK_ARGS are" |
113 |
- #echo ${GK_ARGS} |
114 |
+ #echo ${GK_ARGS[@]} |
115 |
export clst_kernel_merge |
116 |
export clst_initramfs_overlay |
117 |
# Build our list of kernel packages |
118 |
@@ -115,9 +117,9 @@ genkernel_compile(){ |
119 |
if [ "${clst_kernel_merge}" != "" ] |
120 |
then |
121 |
genkernel --callback="emerge ${gk_callback_opts} ${clst_kernel_merge}" \ |
122 |
- ${GK_ARGS} || exit 1 |
123 |
+ "${GK_ARGS[@]}" || exit 1 |
124 |
else |
125 |
- genkernel ${GK_ARGS} || exit 1 |
126 |
+ genkernel "${GK_ARGS[@]}" || exit 1 |
127 |
fi |
128 |
if [ -n "${clst_KERNCACHE}" -a -e /var/tmp/${clst_kname}.config ] |
129 |
then |