Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/releng:master commit in: tools-musl/catalyst/portage.amd64.vanilla/make.profile/, ...
Date: Fri, 23 May 2014 01:21:31
Message-Id: 1400808172.c59b1948362b87aa5ca492109e5b148dd299bba9.blueness@gentoo
1 commit: c59b1948362b87aa5ca492109e5b148dd299bba9
2 Author: Felix Janda <felix.janda <AT> posteo <DOT> de>
3 AuthorDate: Thu May 22 20:23:34 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri May 23 01:22:52 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=c59b1948
7
8 tools-musl: add experimental catalyst build scripts
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11
12 ---
13 tools-musl/catalyst/clean.sh | 6 +
14 tools-musl/catalyst/portage.amd64.vanilla/bashrc | 15 +++
15 .../portage.amd64.vanilla/env/libintl.conf | 2 +
16 .../portage.amd64.vanilla/env/parallel.conf | 1 +
17 .../portage.amd64.vanilla/make.profile/parent | 1 +
18 .../catalyst/portage.amd64.vanilla/package.env | 9 ++
19 .../portage.amd64.vanilla/package.keywords | 2 +
20 .../catalyst/portage.amd64.vanilla/package.mask | 3 +
21 .../catalyst/portage.amd64.vanilla/package.unmask | 1 +
22 .../catalyst/portage.amd64.vanilla/package.use | 1 +
23 tools-musl/catalyst/run.sh | 131 +++++++++++++++++++++
24 tools-musl/catalyst/stage-all.conf.template | 12 ++
25 12 files changed, 184 insertions(+)
26
27 diff --git a/tools-musl/catalyst/clean.sh b/tools-musl/catalyst/clean.sh
28 new file mode 100755
29 index 0000000..916c4eb
30 --- /dev/null
31 +++ b/tools-musl/catalyst/clean.sh
32 @@ -0,0 +1,6 @@
33 +#!/bin/bash
34 +
35 +# This just removes the temporary conf err and log
36 +# files generated during a run
37 +
38 +rm -f *conf *err *log
39
40 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/bashrc b/tools-musl/catalyst/portage.amd64.vanilla/bashrc
41 new file mode 100644
42 index 0000000..dac928d
43 --- /dev/null
44 +++ b/tools-musl/catalyst/portage.amd64.vanilla/bashrc
45 @@ -0,0 +1,15 @@
46 +post_src_install() {
47 + [[ $PN != musl ]] && return 0
48 +
49 + local arch=$(basename "${D}"/lib/ld-musl-*.so.1)
50 + mkdir "${D}"/usr/etc
51 + cat > "${D}"/usr/etc/${arch%so.1}path <<EOF
52 +/lib
53 +/usr/lib
54 +/usr/local/lib
55 +/usr/lib/opengl/xorg-x11/lib
56 +/usr/lib/gcc/x86_64-gentoo-linux-musl/4.7.3
57 +/usr/x86_64-gentoo-linux-musl/lib
58 +/usr/games/lib
59 +EOF
60 +}
61
62 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/env/libintl.conf b/tools-musl/catalyst/portage.amd64.vanilla/env/libintl.conf
63 new file mode 100644
64 index 0000000..06356b5
65 --- /dev/null
66 +++ b/tools-musl/catalyst/portage.amd64.vanilla/env/libintl.conf
67 @@ -0,0 +1,2 @@
68 +CFLAGS="-Wl,-lintl"
69 +LDFLAGS="-lintl"
70
71 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/env/parallel.conf b/tools-musl/catalyst/portage.amd64.vanilla/env/parallel.conf
72 new file mode 100644
73 index 0000000..c67232a
74 --- /dev/null
75 +++ b/tools-musl/catalyst/portage.amd64.vanilla/env/parallel.conf
76 @@ -0,0 +1 @@
77 +MAKEOPTS=-j1
78
79 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/make.profile/parent b/tools-musl/catalyst/portage.amd64.vanilla/make.profile/parent
80 new file mode 100644
81 index 0000000..d224f93
82 --- /dev/null
83 +++ b/tools-musl/catalyst/portage.amd64.vanilla/make.profile/parent
84 @@ -0,0 +1 @@
85 +/usr/portage/profiles/hardened/linux/musl/amd64
86
87 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/package.env b/tools-musl/catalyst/portage.amd64.vanilla/package.env
88 new file mode 100644
89 index 0000000..3574877
90 --- /dev/null
91 +++ b/tools-musl/catalyst/portage.amd64.vanilla/package.env
92 @@ -0,0 +1,9 @@
93 +dev-libs/glib libintl.conf
94 +dev-libs/libelf libintl.conf
95 +sys-apps/attr libintl.conf
96 +sys-apps/kbd libintl.conf
97 +sys-apps/man-db parallel.conf
98 +sys-apps/net-tools libintl.conf
99 +sys-fs/e2fsprogs libintl.conf
100 +sys-fs/eudev libintl.conf
101 +sys-process/procps libintl.conf
102
103 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/package.keywords b/tools-musl/catalyst/portage.amd64.vanilla/package.keywords
104 new file mode 100644
105 index 0000000..9a9769c
106 --- /dev/null
107 +++ b/tools-musl/catalyst/portage.amd64.vanilla/package.keywords
108 @@ -0,0 +1,2 @@
109 +=sys-libs/musl-1.1.0 ~*
110 +=sys-apps/getent-0 ~*
111
112 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/package.mask b/tools-musl/catalyst/portage.amd64.vanilla/package.mask
113 new file mode 100644
114 index 0000000..794369e
115 --- /dev/null
116 +++ b/tools-musl/catalyst/portage.amd64.vanilla/package.mask
117 @@ -0,0 +1,3 @@
118 +>sys-devel/gcc-4.7.3-r99
119 +sys-apps/systemd
120 +sys-fs/udev
121
122 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/package.unmask b/tools-musl/catalyst/portage.amd64.vanilla/package.unmask
123 new file mode 100644
124 index 0000000..6aabccd
125 --- /dev/null
126 +++ b/tools-musl/catalyst/portage.amd64.vanilla/package.unmask
127 @@ -0,0 +1 @@
128 +=dev-libs/openssl-1.0.1g-r99::hardened-dev
129
130 diff --git a/tools-musl/catalyst/portage.amd64.vanilla/package.use b/tools-musl/catalyst/portage.amd64.vanilla/package.use
131 new file mode 100644
132 index 0000000..4ef695a
133 --- /dev/null
134 +++ b/tools-musl/catalyst/portage.amd64.vanilla/package.use
135 @@ -0,0 +1 @@
136 +sys-libs/musl nls
137
138 diff --git a/tools-musl/catalyst/run.sh b/tools-musl/catalyst/run.sh
139 new file mode 100755
140 index 0000000..f72f925
141 --- /dev/null
142 +++ b/tools-musl/catalyst/run.sh
143 @@ -0,0 +1,131 @@
144 +#!/bin/bash
145 +
146 +source /etc/catalyst/catalyst.conf
147 +
148 +mydate=`date +%Y%m%d`
149 +
150 +undo_grsec() {
151 + [[ -d /proc/sys/kernel/grsecurity ]] || return
152 + for i in /proc/sys/kernel/grsecurity/chroot_* ; do
153 + echo 0 > $i
154 + done
155 +}
156 +
157 +prepare_confs() {
158 + local arch=$1
159 + local flavor=$2
160 +
161 + for s in 1 2 3; do
162 +
163 + local cstage=stage${s}
164 + local p=$(( s - 1 ))
165 + [[ $p == 0 ]] && p=3
166 + local pstage=stage${p}
167 +
168 + local parch="${arch}"
169 + [[ "${arch}" == "i686" ]] && parch="x86"
170 +
171 + local tarch="${arch}"
172 + [[ "${arch}" == "amd64" ]] && tarch="x86_64"
173 +
174 + cat stage-all.conf.template | \
175 + sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
176 + -e "s:CSTAGE:${cstage}:g" \
177 + -e "s:PSTAGE:${pstage}:g" \
178 + -e "s:SARCH:${arch}:g" \
179 + -e "s:PARCH:${parch}:g" \
180 + -e "s:TARCH:${tarch}:g" \
181 + -e "s:FLAVOR:${flavor}:g" \
182 + -e "s:MYCATALYST:$(pwd):g" \
183 + > stage${s}-${arch}-musl-${flavor}.conf
184 + done
185 +
186 + sed -i "/^chost/d" stage3-${arch}-musl-${flavor}.conf
187 +}
188 +
189 +banner() {
190 +cat << EOF | tee -a zzz.log > stage$1-$2-musl-$3.log
191 +
192 +************************************************************************
193 +* stage$1-$2-musl-$3
194 +************************************************************************"
195 +
196 +EOF
197 +}
198 +
199 +
200 +do_stages() {
201 + local arch=$1
202 + local flavor=$2
203 +
204 + for s in 1 2 3; do
205 + local tgpath="${storedir}/builds/${flavor}/${arch}"
206 + local target="stage${s}-${arch}-musl-${flavor}-${mydate}.tar.bz2"
207 + local tglink="stage${s}-${arch}-musl-${flavor}.tar.bz2"
208 +
209 + if [[ ! -f "${tgpath}/${tglink}" ]]; then
210 + touch stage${s}-${arch}-musl-${flavor}.log
211 + echo "!!! ${tglink} at ${tgpath} doesn't exist" \
212 + | tee -a zzz.log \
213 + > stage${s}-${arch}-musl-${flavor}.err
214 + return 1
215 + fi
216 +
217 + banner ${s} ${arch} ${flavor}
218 + catalyst -f stage${s}-${arch}-musl-${flavor}.conf \
219 + | tee -a zzz.log \
220 + > stage${s}-${arch}-musl-${flavor}.log \
221 + 2> stage${s}-${arch}-musl-${flavor}.err
222 +
223 + if [[ -f "${tgpath}/${target}" ]]; then
224 + rm -f "${tgpath}/${tglink}"
225 + ln -s ${target} "${tgpath}/${tglink}"
226 + else
227 + echo "!!! ${target} was not generated" \
228 + | tee -a zzz.log \
229 + >stage${s}-${arch}-musl-${flavor}.err
230 + return 1
231 + fi
232 + done
233 +
234 + return 0
235 +}
236 +
237 +
238 +#
239 +# approximate timings:
240 +#
241 +# catalyst -s current 3 minutes
242 +# catalyst -f stage1 130 minutes
243 +#
244 +
245 +main() {
246 + >zzz.log
247 +
248 + undo_grsec
249 +
250 + catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
251 +
252 +# for arch in amd64 i686; do
253 +# for flavor in hardened vanilla; do
254 + for arch in amd64; do
255 + for flavor in vanilla; do
256 + prepare_confs ${arch} ${flavor}
257 + done
258 + done
259 +
260 +# for arch in amd64 i686; do
261 +# for flavor in hardened vanilla; do
262 + for arch in amd64; do
263 + for flavor in vanilla; do
264 + do_stages ${arch} ${flavor}
265 + ret=$?
266 + if [[ $? == 1 ]]; then
267 + echo "FAILURE at ${arch} ${flavor}" | tee zzz.log
268 + return 1
269 + fi
270 + done
271 + done
272 +}
273 +
274 +main $1 &
275
276 diff --git a/tools-musl/catalyst/stage-all.conf.template b/tools-musl/catalyst/stage-all.conf.template
277 new file mode 100644
278 index 0000000..6bc302b
279 --- /dev/null
280 +++ b/tools-musl/catalyst/stage-all.conf.template
281 @@ -0,0 +1,12 @@
282 +subarch: SARCH
283 +target: CSTAGE
284 +version_stamp: musl-FLAVOR
285 +rel_type: FLAVOR/SARCH
286 +profile: hardened/linux/musl/PARCH
287 +snapshot: current
288 +source_subpath: FLAVOR/SARCH/PSTAGE-SARCH-musl-FLAVOR
289 +chost: TARCH-gentoo-linux-musl
290 +cflags: -O2 -pipe -fomit-frame-pointer
291 +cxxflags: -O2 -pipe -fomit-frame-pointer
292 +portage_confdir: MYCATALYST/portage.SARCH.FLAVOR
293 +portage_overlay: /var/lib/layman/hardened-development