forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpm-deps.sh
executable file
·136 lines (120 loc) · 3.77 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
#!/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 and virt-handler. This is the OS for our node-components.
bazel run \
--config=${ARCHITECTURE} \
//:bazeldnf -- rpmtree --public --name launcherbase_x86_64 \
$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 \
$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
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