1 |
commit: 54ad5b197e26018a804b912e95485b50600bc5cc |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 28 10:44:04 2014 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 28 10:44:04 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=54ad5b19 |
7 |
|
8 |
tools-musl: pull out code in run scripts |
9 |
|
10 |
--- |
11 |
tools-musl/{run.sh => common.sh} | 60 +--------------------------------------- |
12 |
tools-musl/run-armv7a.sh | 52 +--------------------------------- |
13 |
tools-musl/run-mipsel3.sh | 51 +--------------------------------- |
14 |
tools-musl/run.sh | 59 +-------------------------------------- |
15 |
4 files changed, 4 insertions(+), 218 deletions(-) |
16 |
|
17 |
diff --git a/tools-musl/run.sh b/tools-musl/common.sh |
18 |
old mode 100755 |
19 |
new mode 100644 |
20 |
similarity index 53% |
21 |
copy from tools-musl/run.sh |
22 |
copy to tools-musl/common.sh |
23 |
index 55651d1..2420b85 |
24 |
--- a/tools-musl/run.sh |
25 |
+++ b/tools-musl/common.sh |
26 |
@@ -4,6 +4,7 @@ source /etc/catalyst/catalyst.conf |
27 |
|
28 |
mydate=`date +%Y%m%d` |
29 |
|
30 |
+ |
31 |
undo_grsec() { |
32 |
[[ -d /proc/sys/kernel/grsecurity ]] || return |
33 |
for i in /proc/sys/kernel/grsecurity/chroot_* ; do |
34 |
@@ -11,37 +12,6 @@ undo_grsec() { |
35 |
done |
36 |
} |
37 |
|
38 |
-prepare_confs() { |
39 |
- local arch=$1 |
40 |
- local flavor=$2 |
41 |
- |
42 |
- for s in 1 2 3; do |
43 |
- |
44 |
- local cstage=stage${s} |
45 |
- local p=$(( s - 1 )) |
46 |
- [[ $p == 0 ]] && p=3 |
47 |
- local pstage=stage${p} |
48 |
- |
49 |
- local parch="${arch}" |
50 |
- [[ "${arch}" == "i686" ]] && parch="x86" |
51 |
- |
52 |
- local tarch="${arch}" |
53 |
- [[ "${arch}" == "amd64" ]] && tarch="x86_64" |
54 |
- |
55 |
- cat stage-all.conf.template | \ |
56 |
- sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \ |
57 |
- -e "s:CSTAGE:${cstage}:g" \ |
58 |
- -e "s:PSTAGE:${pstage}:g" \ |
59 |
- -e "s:SARCH:${arch}:g" \ |
60 |
- -e "s:PARCH:${parch}:g" \ |
61 |
- -e "s:TARCH:${tarch}:g" \ |
62 |
- -e "s:FLAVOR:${flavor}:g" \ |
63 |
- -e "s:MYCATALYST:$(pwd):g" \ |
64 |
- > stage${s}-${arch}-musl-${flavor}.conf |
65 |
- done |
66 |
- |
67 |
- sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf |
68 |
-} |
69 |
|
70 |
banner() { |
71 |
cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log |
72 |
@@ -90,31 +60,3 @@ do_stages() { |
73 |
|
74 |
return 0 |
75 |
} |
76 |
- |
77 |
- |
78 |
-main() { |
79 |
- >zzz.log |
80 |
- |
81 |
- undo_grsec |
82 |
- |
83 |
- catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err |
84 |
- |
85 |
- for arch in amd64 i686; do |
86 |
- for flavor in vanilla hardened; do |
87 |
- prepare_confs ${arch} ${flavor} |
88 |
- done |
89 |
- done |
90 |
- |
91 |
- for arch in amd64 i686; do |
92 |
- for flavor in vanilla hardened; do |
93 |
- do_stages ${arch} ${flavor} |
94 |
- ret=$? |
95 |
- if [[ $? == 1 ]]; then |
96 |
- echo "FAILURE at ${arch} ${flavor} " | tee zzz.log |
97 |
- return 1 |
98 |
- fi |
99 |
- done |
100 |
- done |
101 |
-} |
102 |
- |
103 |
-main $1 & |
104 |
|
105 |
diff --git a/tools-musl/run-armv7a.sh b/tools-musl/run-armv7a.sh |
106 |
index f170931..ad4fa3a 100755 |
107 |
--- a/tools-musl/run-armv7a.sh |
108 |
+++ b/tools-musl/run-armv7a.sh |
109 |
@@ -1,8 +1,6 @@ |
110 |
#!/bin/bash |
111 |
|
112 |
-source /etc/catalyst/catalyst.conf |
113 |
- |
114 |
-mydate=`date +%Y%m%d` |
115 |
+source common.sh |
116 |
|
117 |
prepare_confs() { |
118 |
local arch=$1 |
119 |
@@ -42,54 +40,6 @@ prepare_confs() { |
120 |
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf |
121 |
} |
122 |
|
123 |
-banner() { |
124 |
-cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log |
125 |
- |
126 |
-************************************************************************ |
127 |
-* stage$1-$2-musl-$3 |
128 |
-************************************************************************" |
129 |
- |
130 |
-EOF |
131 |
-} |
132 |
- |
133 |
- |
134 |
-do_stages() { |
135 |
- local arch=$1 |
136 |
- local flavor=$2 |
137 |
- |
138 |
- for s in 1 2 3; do |
139 |
- local tgpath="${storedir}/builds/musl/${flavor}/${arch}" |
140 |
- local target="stage${s}-${arch}-musl-${flavor}-${mydate}.tar.bz2" |
141 |
- local tglink="stage${s}-${arch}-musl-${flavor}.tar.bz2" |
142 |
- |
143 |
- if [[ ! -f "${tgpath}/${tglink}" ]]; then |
144 |
- touch stage${s}-${arch}-musl-${flavor}.log |
145 |
- echo "!!! ${target} at ${tgpath} doesn't exit" \ |
146 |
- | tee -a zzz.log \ |
147 |
- > stage${s}-${arch}-musl-${flavor}.err |
148 |
- return 1 |
149 |
- fi |
150 |
- |
151 |
- banner ${s} ${arch} ${flavor} |
152 |
- catalyst -f stage${s}-${arch}-musl-${flavor}.conf \ |
153 |
- | tee -a zzz.log \ |
154 |
- > stage${s}-${arch}-musl-${flavor}.log \ |
155 |
- 2> stage${s}-${arch}-musl-${flavor}.err |
156 |
- |
157 |
- if [[ -f "${tgpath}/${target}" ]]; then |
158 |
- rm -f "${tgpath}/${tglink}" |
159 |
- ln -s ${target} "${tgpath}/${tglink}" |
160 |
- else |
161 |
- echo "!!! ${target} was not generated" \ |
162 |
- | tee -a zzz.log \ |
163 |
- >stage${s}-${arch}-musl-${flavor}.err |
164 |
- return 1 |
165 |
- fi |
166 |
- done |
167 |
- |
168 |
- return 0 |
169 |
-} |
170 |
- |
171 |
|
172 |
main() { |
173 |
>zzz.log |
174 |
|
175 |
diff --git a/tools-musl/run-mipsel3.sh b/tools-musl/run-mipsel3.sh |
176 |
index 3da4f1c..3d70505 100755 |
177 |
--- a/tools-musl/run-mipsel3.sh |
178 |
+++ b/tools-musl/run-mipsel3.sh |
179 |
@@ -1,8 +1,6 @@ |
180 |
#!/bin/bash |
181 |
|
182 |
-source /etc/catalyst/catalyst.conf |
183 |
- |
184 |
-mydate=`date +%Y%m%d` |
185 |
+source common.sh |
186 |
|
187 |
prepare_confs() { |
188 |
local arch=$1 |
189 |
@@ -34,53 +32,6 @@ prepare_confs() { |
190 |
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf |
191 |
} |
192 |
|
193 |
-banner() { |
194 |
-cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log |
195 |
- |
196 |
-************************************************************************ |
197 |
-* stage$1-$2-musl-$3 |
198 |
-************************************************************************" |
199 |
- |
200 |
-EOF |
201 |
-} |
202 |
- |
203 |
- |
204 |
-do_stages() { |
205 |
- local arch=$1 |
206 |
- local flavor=$2 |
207 |
- |
208 |
- for s in 1 2 3; do |
209 |
- local tgpath="${storedir}/builds/musl/${flavor}/${arch}" |
210 |
- local target="stage${s}-${arch}-musl-${flavor}-${mydate}.tar.bz2" |
211 |
- local tglink="stage${s}-${arch}-musl-${flavor}.tar.bz2" |
212 |
- |
213 |
- if [[ ! -f "${tgpath}/${tglink}" ]]; then |
214 |
- touch stage${s}-${arch}-musl-${flavor}.log |
215 |
- echo "!!! ${target} at ${tgpath} doesn't exit" \ |
216 |
- | tee -a zzz.log \ |
217 |
- > stage${s}-${arch}-musl-${flavor}.err |
218 |
- return 1 |
219 |
- fi |
220 |
- |
221 |
- banner ${s} ${arch} ${flavor} |
222 |
- catalyst -f stage${s}-${arch}-musl-${flavor}.conf \ |
223 |
- | tee -a zzz.log \ |
224 |
- > stage${s}-${arch}-musl-${flavor}.log \ |
225 |
- 2> stage${s}-${arch}-musl-${flavor}.err |
226 |
- |
227 |
- if [[ -f "${tgpath}/${target}" ]]; then |
228 |
- rm -f "${tgpath}/${tglink}" |
229 |
- ln -s ${target} "${tgpath}/${tglink}" |
230 |
- else |
231 |
- echo "!!! ${target} was not generated" \ |
232 |
- | tee -a zzz.log \ |
233 |
- >stage${s}-${arch}-musl-${flavor}.err |
234 |
- return 1 |
235 |
- fi |
236 |
- done |
237 |
- |
238 |
- return 0 |
239 |
-} |
240 |
|
241 |
|
242 |
main() { |
243 |
|
244 |
diff --git a/tools-musl/run.sh b/tools-musl/run.sh |
245 |
index 55651d1..84609aa 100755 |
246 |
--- a/tools-musl/run.sh |
247 |
+++ b/tools-musl/run.sh |
248 |
@@ -1,15 +1,6 @@ |
249 |
#!/bin/bash |
250 |
|
251 |
-source /etc/catalyst/catalyst.conf |
252 |
- |
253 |
-mydate=`date +%Y%m%d` |
254 |
- |
255 |
-undo_grsec() { |
256 |
- [[ -d /proc/sys/kernel/grsecurity ]] || return |
257 |
- for i in /proc/sys/kernel/grsecurity/chroot_* ; do |
258 |
- echo 0 > $i |
259 |
- done |
260 |
-} |
261 |
+source common.sh |
262 |
|
263 |
prepare_confs() { |
264 |
local arch=$1 |
265 |
@@ -43,54 +34,6 @@ prepare_confs() { |
266 |
sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf |
267 |
} |
268 |
|
269 |
-banner() { |
270 |
-cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log |
271 |
- |
272 |
-************************************************************************ |
273 |
-* stage$1-$2-musl-$3 |
274 |
-************************************************************************" |
275 |
- |
276 |
-EOF |
277 |
-} |
278 |
- |
279 |
- |
280 |
-do_stages() { |
281 |
- local arch=$1 |
282 |
- local flavor=$2 |
283 |
- |
284 |
- for s in 1 2 3; do |
285 |
- local tgpath="${storedir}/builds/musl/${flavor}/${arch}" |
286 |
- local target="stage${s}-${arch}-musl-${flavor}-${mydate}.tar.bz2" |
287 |
- local tglink="stage${s}-${arch}-musl-${flavor}.tar.bz2" |
288 |
- |
289 |
- if [[ ! -f "${tgpath}/${tglink}" ]]; then |
290 |
- touch stage${s}-${arch}-musl-${flavor}.log |
291 |
- echo "!!! ${tglink} at ${tgpath} doesn't exist" \ |
292 |
- | tee -a zzz.log \ |
293 |
- > stage${s}-${arch}-musl-${flavor}.err |
294 |
- return 1 |
295 |
- fi |
296 |
- |
297 |
- banner ${s} ${arch} ${flavor} |
298 |
- catalyst -f stage${s}-${arch}-musl-${flavor}.conf \ |
299 |
- | tee -a zzz.log \ |
300 |
- > stage${s}-${arch}-musl-${flavor}.log \ |
301 |
- 2> stage${s}-${arch}-musl-${flavor}.err |
302 |
- |
303 |
- if [[ -f "${tgpath}/${target}" ]]; then |
304 |
- rm -f "${tgpath}/${tglink}" |
305 |
- ln -s ${target} "${tgpath}/${tglink}" |
306 |
- else |
307 |
- echo "!!! ${target} was not generated" \ |
308 |
- | tee -a zzz.log \ |
309 |
- >stage${s}-${arch}-musl-${flavor}.err |
310 |
- return 1 |
311 |
- fi |
312 |
- done |
313 |
- |
314 |
- return 0 |
315 |
-} |
316 |
- |
317 |
|
318 |
main() { |
319 |
>zzz.log |