Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/
Date: Thu, 29 Oct 2020 21:00:48
Message-Id: 1603236395.e96ef61854ae6f85f90dc9f5e01b5e1743c8a6f6.mattst88@gentoo
1 commit: e96ef61854ae6f85f90dc9f5e01b5e1743c8a6f6
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 20 02:48:07 2020 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 20 23:26:35 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e96ef618
7
8 targets: Use double-brackets in kmerge.sh
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 targets/support/kmerge.sh | 50 ++++++++++++++---------------------------------
13 1 file changed, 15 insertions(+), 35 deletions(-)
14
15 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
16 index 5e284183..fb67aba6 100755
17 --- a/targets/support/kmerge.sh
18 +++ b/targets/support/kmerge.sh
19 @@ -15,71 +15,51 @@ genkernel_compile() {
20 --minkernpackage=/tmp/kerncache/${kname}-kernel-initrd-${clst_version_stamp}.tar.bz2 all
21 )
22 # extra genkernel options that we have to test for
23 - if [ -n "${clst_gk_mainargs}" ]
24 - then
25 + if [[ -n ${clst_gk_mainargs} ]]; then
26 GK_ARGS+=(${clst_gk_mainargs})
27 fi
28 - if [ -n "${clst_KERNCACHE}" ]
29 - then
30 + if [[ -n ${clst_KERNCACHE} ]]; then
31 GK_ARGS+=(--kerncache=/tmp/kerncache/${kname}-kerncache-${clst_version_stamp}.tar.bz2)
32 fi
33 - if [ -e /var/tmp/${kname}.config ]
34 - then
35 + if [[ -e /var/tmp/${kname}.config ]]; then
36 GK_ARGS+=(--kernel-config=/var/tmp/${kname}.config)
37 fi
38 -
39 - if [ -d "/tmp/initramfs_overlay/${initramfs_overlay}" ]
40 - then
41 + if [[ -d /tmp/initramfs_overlay/${initramfs_overlay} ]]; then
42 GK_ARGS+=(--initramfs-overlay=/tmp/initramfs_overlay/${initramfs_overlay})
43 fi
44 - if [ -n "${clst_CCACHE}" ]
45 - then
46 + if [[ -n ${clst_CCACHE} ]]; then
47 GK_ARGS+=(--kernel-cc=/usr/lib/ccache/bin/gcc --utils-cc=/usr/lib/ccache/bin/gcc)
48 fi
49 -
50 - if [ -n "${clst_linuxrc}" ]
51 - then
52 + if [[ -n ${clst_linuxrc} ]]; then
53 GK_ARGS+=(--linuxrc=/tmp/linuxrc)
54 fi
55 -
56 - if [ -n "${clst_busybox_config}" ]
57 - then
58 + if [[ -n ${clst_busybox_config} ]]; then
59 GK_ARGS+=(--busybox-config=/tmp/busy-config)
60 fi
61 -
62 - if [ "${clst_target}" == "netboot" ]
63 - then
64 + if [[ ${clst_target} == netboot ]]; then
65 GK_ARGS+=(--netboot)
66
67 - if [ -n "${clst_merge_path}" ]
68 - then
69 + if [[ -n ${clst_merge_path} ]]; then
70 GK_ARGS+=(--initramfs-overlay="${clst_merge_path}")
71 fi
72 fi
73 -
74 - if [ -n "${clst_VERBOSE}" ]
75 - then
76 + if [[ -n ${clst_VERBOSE} ]]; then
77 GK_ARGS+=(--loglevel=2)
78 fi
79
80 - # Build with genkernel using the set options
81 - # callback is put here to avoid escaping issues
82 - if [ -n "${clst_VERBOSE}" ]
83 - then
84 + if [[ -n ${clst_VERBOSE} ]]; then
85 gk_callback_opts=(-vN)
86 else
87 gk_callback_opts=(-qN)
88 fi
89 - if [ -n "${clst_KERNCACHE}" ]
90 - then
91 + if [[ -n ${clst_KERNCACHE} ]]; then
92 gk_callback_opts+=(-kb)
93 fi
94 - if [ -n "${clst_FETCH}" ]
95 - then
96 + if [[ -n ${clst_FETCH} ]]; then
97 gk_callback_opts+=(-f)
98 fi
99 - if [ "${kernel_merge}" != "" ]
100 - then
101 +
102 + if [[ -n ${kernel_merge} ]]; then
103 genkernel --callback="emerge ${gk_callback_opts[@]} ${kernel_merge}" \
104 "${GK_ARGS[@]}" || exit 1
105 else