forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpm-deps.sh
executable file
·267 lines (240 loc) · 6.29 KB
/
rpm-deps.sh
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/usr/bin/env bash
set -ex
source hack/common.sh
source hack/bootstrap.sh
source hack/config.sh
LIBVIRT_VERSION=0:7.0.0-14.el8s
QEMU_VERSION=15:5.2.0-16.el8s
SEABIOS_VERSION=0:1.14.0-1.el8s
EDK2_VERSION=0:20200602gitca407c7246bf-4.el8
LIBGUESTFS_VERSION=1:1.44.0-3.el8s
# Packages that we want to be included in all container images.
#
# Further down we define per-image package lists, which are just like
# this one are split into two: one for the packages that we actually
# want to have in the image, and one for (indirect) dependencies that
# have more than one way of being resolved. Listing the latter
# explicitly ensures that bazeldnf always reaches the same solution
# and thus keeps things reproducible
centos_base="
acl
curl
vim-minimal
"
centos_extra="
coreutils-single
glibc-minimal-langpack
libcurl-minimal
"
# get latest repo data from repo.yaml
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- fetch
# create a rpmtree for our test image with misc. tools.
testimage_base="
device-mapper
e2fsprogs
iputils
nmap-ncat
procps-ng
qemu-img
util-linux
which
"
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public \
--name testimage_x86_64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$testimage_base
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public \
--name testimage_aarch64 --arch aarch64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$testimage_base
# create a rpmtree for libvirt-devel. libvirt-devel is needed for compilation and unit-testing.
libvirtdevel_base="
libvirt-devel-${LIBVIRT_VERSION}
"
libvirtdevel_extra="
keyutils-libs
krb5-libs
libmount
lz4-libs
"
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name libvirt-devel_x86_64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$libvirtdevel_base \
$libvirtdevel_extra
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name libvirt-devel_aarch64 --arch aarch64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$libvirtdevel_base \
$libvirtdevel_extra
# TODO: Remove the sssd-client and use a better sssd config
# This requires a way to inject files into the sandbox via bazeldnf
sandbox_base="
findutils
gcc
glibc-static
python36
sssd-client
"
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name sandboxroot_x86_64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$sandbox_base
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name sandboxroot_aarch64 --arch aarch64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$sandbox_base
# create a rpmtree for virt-launcher and virt-handler. This is the OS for our node-components.
launcherbase_base="
libvirt-client-${LIBVIRT_VERSION}
libvirt-daemon-driver-qemu-${LIBVIRT_VERSION}
qemu-kvm-core-${QEMU_VERSION}
python36
"
launcherbase_x86_64="
edk2-ovmf-${EDK2_VERSION}
seabios-${SEABIOS_VERSION}
"
launcherbase_aarch64="
edk2-aarch64-${EDK2_VERSION}
"
launcherbase_extra="
findutils
iptables
nftables
procps-ng
selinux-policy
selinux-policy-targeted
tar
xorriso
"
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name launcherbase_x86_64 \
--basesystem centos-stream-release \
--force-ignore-with-dependencies '^mozjs60' \
$centos_base \
$centos_extra \
$launcherbase_base \
$launcherbase_x86_64 \
$launcherbase_extra
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree \
--public --nobest \
--name launcherbase_aarch64 --arch aarch64 \
--basesystem centos-stream-release \
--force-ignore-with-dependencies '^mozjs60' \
$centos_base \
$centos_extra \
$launcherbase_base \
$launcherbase_aarch64 \
$launcherbase_extra
handler_base="
qemu-img-${QEMU_VERSION}
"
handlerbase_extra="
findutils
iproute
iptables
nftables
procps-ng
selinux-policy
selinux-policy-targeted
tar
util-linux
xorriso
"
# create a rpmtree for virt-handler
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --arch=aarch64 --name handlerbase_aarch64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$handler_base \
$handlerbase_extra
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name handlerbase_x86_64 \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$handler_base \
$handlerbase_extra
libguestfstools_base="
libguestfs-tools-${LIBGUESTFS_VERSION}
libvirt-daemon-driver-qemu-${LIBVIRT_VERSION}
qemu-kvm-core-${QEMU_VERSION}
seabios-${SEABIOS_VERSION}
"
libguestfstools_x86_64="
edk2-ovmf-${EDK2_VERSION}
"
bazel run \
//:bazeldnf -- rpmtree \
--public --nobest \
--name libguestfs-tools \
--basesystem centos-stream-release \
$centos_base \
$centos_extra \
$libguestfstools_base \
$libguestfstools_x86_64 \
--force-ignore-with-dependencies '^(kernel-|linux-firmware)' \
--force-ignore-with-dependencies '^(python[3]{0,1}-|perl[3]{0,1}-)' \
--force-ignore-with-dependencies '^(mesa-|libwayland-|selinux-policy|mozjs60)' \
--force-ignore-with-dependencies '^(libvirt-daemon-driver-storage|swtpm)' \
--force-ignore-with-dependencies '^(man-db|mandoc)' \
--force-ignore-with-dependencies '^(dbus|glusterfs|libX11|qemu-kvm-block|trousers|usbredir)' \
--force-ignore-with-dependencies '^(gstreamer1|kbd|libX)'
# remove all RPMs which are no longer referenced by a rpmtree
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- prune
# update tar2files targets which act as an adapter between rpms
# and cc_library which we need for virt-launcher and virt-handler
bazel run \
--config=${ARCHITECTURE} \
//rpm:ldd_x86_64
bazel run \
--config=${ARCHITECTURE} \
//rpm:ldd_aarch64
# regenerate sandboxes
rm ${SANDBOX_DIR} -rf
kubevirt::bootstrap::regenerate aarch64
rm ${SANDBOX_DIR} -rf
kubevirt::bootstrap::regenerate x86_64