-
Notifications
You must be signed in to change notification settings - Fork 7
/
barney.yaml
231 lines (214 loc) · 7.84 KB
/
barney.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Copyright (c) 2022 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
images:
build-floor:
units:
- image: barney.ci/debian%network
- image: barney.ci/debian%pkg/build-essential
- image: barney.ci/debian%pkg/curl
- image: barney.ci/debian%pkg/file
- image: barney.ci/debian%pkg/gawk
- image: barney.ci/debian%pkg/gettext
- image: barney.ci/debian%pkg/git
- image: barney.ci/debian%pkg/libncurses-dev
- image: barney.ci/debian%pkg/libssl-dev
- image: barney.ci/debian%pkg/meson
- image: barney.ci/debian%pkg/openssh-client
- image: barney.ci/debian%pkg/perl-openssl-defaults
- image: barney.ci/debian%pkg/python3
- image: barney.ci/debian%pkg/python3-distutils-extra
- image: barney.ci/debian%pkg/qemu-utils
- image: barney.ci/debian%pkg/rsync
- image: barney.ci/debian%pkg/ruby-sass
- image: barney.ci/debian%pkg/swig
- image: barney.ci/debian%pkg/time
- image: barney.ci/debian%pkg/unzip
- image: barney.ci/debian%pkg/wget
- image: barney.ci/debian%pkg/zlib1g-dev
entry:
mutables:
- /root
env:
FORCE_UNSAFE_CONFIGURE: 1
HOME: /root
test/build-floor:
description: |
Check that we can run a couple of utilities
units:
- floor: .%build-floor
build: |
curl --version
make --version
meson --version
python3 --version
toolchain:
description: |
Build an x86_64 openwrt toolchain for musl, and store the
corresponding staging_dir under /mfw-toolchain.
This directory can be then copied into the openwrt downstream
builds, by copying it back into the corresponding source tree.
units:
- image: .%build-floor
- floor: .%build-floor
sources: [ code.arista.io/mfw/build, github.com/untangle/openwrt ]
build: |
set -e
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build toolchain
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -u -t toolchain/install
# store built toolchain
mkdir -p /dest/mfw-toolchain
cp -a staging_dir/ /dest/mfw-toolchain/
test/toolchain:
description: |
Check that gcc can run
units:
- floor: .%toolchain
build: |
/mfw-toolchain/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc --version
toolchain-glibc:
description: |
Build an x86_64 openwrt toolchain for glibc, and store the
corresponding staging_dir under /mfw-toolchain.
This directory can be then copied into the openwrt downstream
builds, by copying it back into the corresponding source tree.
units:
- image: .%build-floor
- floor: .%build-floor
sources: [ code.arista.io/mfw/build, github.com/untangle/openwrt ]
build: |
set -e
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build toolchain
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -l glibc -u -t toolchain/install
# store built toolchain
mkdir -p /dest/mfw-toolchain
cp -a staging_dir/ /dest/mfw-toolchain/
test/toolchain-glibc:
description: |
Check that gcc can run
units:
- floor: .%toolchain-glibc
build: |
/mfw-toolchain/staging_dir/toolchain-x86_64_gcc-8.4.0_glibc/bin/x86_64-openwrt-linux-gnu-gcc --version
golang:
description: |
Build the golang compiler on top of the x86_64 openwrt toolchain.
units:
- image: .%toolchain
- floor: .%toolchain
sources: [ code.arista.io/mfw/build, github.com/untangle/openwrt ]
build: |
set -e
# copy build%toolchain's staging_dir into our source tree
cp -a /mfw-toolchain/staging_dir /src/github.com/untangle/openwrt/
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build golang
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -u -t package/feeds/packages/golang/host/compile
# store built golang alongside existing toolchain
mkdir -p /dest/mfw-toolchain/staging_dir/
cp -a staging_dir/hostpkg /dest/mfw-toolchain/staging_dir/
test/golang:
description: |
Check that the golang compiler can run
units:
- floor: .%golang
build: |
/mfw-toolchain/staging_dir/hostpkg/bin/go version
golang-glibc:
description: |
Build the golang compiler on top of the x86_64 openwrt toolchain
for glibc.
units:
- image: .%toolchain-glibc
- floor: .%toolchain-glibc
sources: [ code.arista.io/mfw/build, github.com/untangle/openwrt ]
build: |
set -e
# copy build%toolchain-glibc's staging_dir into our source tree
cp -a /mfw-toolchain/staging_dir /src/github.com/untangle/openwrt/
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build golang
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -l glibc -u -t package/feeds/packages/golang/host/compile
# store built golang alongside existing toolchain
mkdir -p /dest/mfw-toolchain/staging_dir/
cp -a staging_dir/hostpkg /dest/mfw-toolchain/staging_dir/
test/golang-glibc:
description: |
Check that the golang-glibc compiler can run
units:
- floor: .%golang-glibc
build: |
/mfw-toolchain/staging_dir/hostpkg/bin/go version
world:
description: |
Almost-vanilla openwrt image, with just our kernel patches but no
additional configuration or packages.
This is mostly used as a testbed for installing packages, but it
does not qualify as a valid MFW base layer (see
code.arista.io/mfw/image%internal/mfw-base for that).
units:
- floor: .%toolchain
sources:
- code.arista.io/mfw/build
- github.com/untangle/openwrt
build: |
set -e
# copy build%toolchain's staging_dir into our source tree
cp -a /mfw-toolchain/staging_dir /src/github.com/untangle/openwrt/
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build our world image
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -u
# extract FS content into destination image
tar -C /dest -xavf bin/targets/x86/64/mfw-x86-64-generic-rootfs.tar.gz
test/world:
description: |
Check that some basic openwrt utilities can run
units:
- floor: .%world
build: |
date
ls
ps
world-glibc:
description: |
Almost-vanilla glibc-based openwrt image, with just our kernel
patches but no additional configuration or packages.
This is mostly used as a testbed for installing packages, but it
does not qualify as a valid MFW base layer (see
code.arista.io/mfw/image%internal/mfw-base for that).
units:
- floor: .%toolchain-glibc
sources:
- code.arista.io/mfw/build
- github.com/untangle/openwrt
build: |
set -e
# copy build%toolchain's staging_dir into our source tree
cp -a /mfw-toolchain/staging_dir /src/github.com/untangle/openwrt/
# barney sets DESTDIR to /dest, but this really confuses openwrt
unset DESTDIR
# build our world image
cd /src/github.com/untangle/openwrt
/src/code.arista.io/mfw/build/build.sh -l glibc -u
# extract FS content into destination image
tar -C /dest -xavf bin/targets/x86/64-glibc/mfw-x86-64-generic-rootfs.tar.gz
test/world-glibc:
description: |
Check that some basic openwrt utilities can run
units:
- floor: .%world-glibc
build: |
date
ls
ps