forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpm-deps.sh
executable file
·167 lines (149 loc) · 4.4 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
#!/usr/bin/env bash
set -ex
source hack/common.sh
source hack/config.sh
LIBVIRT_VERSION=0:7.0.0-12
SEABIOS_VERSION=0:1.14.0-1
QEMU_VERSION=15:5.2.0-15
# Define some base packages to avoid dependency flipping
# since some dependencies can be satisfied by multiple packages
basesystem="glibc-langpack-en coreutils-single libcurl-minimal curl-minimal fedora-logos-httpd vim-minimal"
# get latest repo data from repo.yaml
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- fetch
# create a rpmtree for our test image with misc. tools.
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name testimage_x86_64 \
$basesystem \
qemu-img \
which \
nginx \
scsi-target-utils \
procps-ng \
nmap-ncat \
iputils \
e2fsprogs
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --arch=aarch64 --name testimage_aarch64 \
$basesystem \
qemu-img \
which \
nginx \
scsi-target-utils \
procps-ng \
nmap-ncat \
iputils \
e2fsprogs
# create a rpmtree for libvirt-devel. libvirt-devel is needed for compilation and unit-testing.
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name libvirt-devel_x86_64 \
$basesystem \
libvirt-devel-${LIBVIRT_VERSION} \
keyutils-libs \
krb5-libs \
libmount \
lz4-libs
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --arch=aarch64 --name libvirt-devel_aarch64 \
$basesystem \
libvirt-devel-${LIBVIRT_VERSION} \
keyutils-libs \
krb5-libs \
libmount \
lz4-libs
# create a rpmtree for virt-launcher.
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name launcherbase_x86_64 \
--force-ignore-with-dependencies '^mozjs60' \
$basesystem \
libvirt-daemon-driver-qemu-${LIBVIRT_VERSION} \
libvirt-client-${LIBVIRT_VERSION} \
qemu-kvm-core-${QEMU_VERSION} \
seabios-${SEABIOS_VERSION} \
xorriso \
selinux-policy selinux-policy-targeted \
nftables \
findutils \
procps-ng \
iptables \
tar
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --arch=aarch64 --name launcherbase_aarch64 \
--force-ignore-with-dependencies '^mozjs60' \
$basesystem \
libvirt-daemon-driver-qemu-${LIBVIRT_VERSION} \
libvirt-client-${LIBVIRT_VERSION} \
qemu-kvm-core-${QEMU_VERSION} \
xorriso \
selinux-policy selinux-policy-targeted \
nftables \
findutils \
procps-ng \
iptables \
tar
# create a rpmtree for virt-handler
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --arch=aarch64 --name handlerbase_aarch64 \
$basesystem \
qemu-img-${QEMU_VERSION} \
xorriso \
nftables \
findutils \
procps-ng \
iptables \
iproute \
util-linux \
tar
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name handlerbase_x86_64 \
$basesystem \
qemu-img-${QEMU_VERSION} \
xorriso \
nftables \
findutils \
procps-ng \
iptables \
iproute \
util-linux \
tar
bazel run \
//:bazeldnf -- rpmtree --public --name libguestfs-tools \
$basesystem \
libguestfs \
libguestfs-tools \
--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
# FIXME: For an unknown reason the run target afterwards can get
# out dated tar files, build them explicitly first.
bazel build \
--config=${ARCHITECTURE} \
//rpm:libvirt-devel_x86_64
bazel build \
--config=${ARCHITECTURE} \
//rpm:libvirt-devel_aarch64
# 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