Skip to content

Commit efb622a

Browse files
committed
test direct installation of libvirt
1 parent 4cde331 commit efb622a

2 files changed

Lines changed: 69 additions & 1 deletion

File tree

features/sci/exec.config

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,72 @@ chmod 0755 /etc/pki/CA /etc/pki/libvirt /etc/pki/qemu
4040
# limit vnc port autorange to possible kubernetes nodeports
4141
sed -i 's/#remote_display_port_min = 5900/remote_display_port_min = 32200/' /etc/libvirt/qemu.conf
4242
sed -i 's/#remote_display_port_max = 65535/remote_display_port_max = 32299/' /etc/libvirt/qemu.conf
43+
44+
# gh release download --dir "$TEMP_DEB" --repo "$repo" "$tag"
45+
function install_package() {
46+
TEMP_DEB_DIR=$(mktemp -d)
47+
trap 'rm -rf "$TEMP_DEB_DIR"' EXIT
48+
49+
local repo="$1"
50+
local tag="$2"
51+
local arch="$3"
52+
shift 3
53+
local packages="$@"
54+
55+
urls=$(curl -s "https://api.github.com/repos/${repo}/releases/tags/$tag" | jq -r '.assets.[].browser_download_url' | grep "build.tar.xz")
56+
for url in $urls; do
57+
echo "Downloading $url"
58+
(cd "$TEMP_DEB_DIR" && curl -OL "$url")
59+
done
60+
61+
cat "$TEMP_DEB_DIR"/build.tar.xz* | xz -d | tar -C "$TEMP_DEB_DIR" -x
62+
63+
# check if requested packages are there
64+
for package in "$packages"; do
65+
if [ ! -f "$TEMP_DEB_DIR/${package}_${tag}_${arch}.deb" ]; then
66+
echo "Package $package not found for tag $tag and arch $arch"
67+
exit 1
68+
fi
69+
done
70+
71+
# create on variable to install the packages
72+
local package_list=""
73+
for package in "$packages"; do
74+
package_list+="$TEMP_DEB_DIR/${package}_${tag}_${arch}.deb "
75+
done
76+
77+
echo "Installing packages: $package_list"
78+
# Install the packages
79+
DEBIAN_FRONTEND=noninteractive apt install -y $package_list
80+
81+
# Hold the package to prevent it from being removed or upgraded
82+
for package in "$@"; do
83+
apt-mark hold "${package}"
84+
done
85+
}
86+
87+
arch="$(dpkg --print-architecture)"
88+
89+
# # Install cloud-hypervisor-gl package
90+
# install_package "cloud-hypervisor-gl" "gardenlinux/package-cloud-hypervisor-gl" "46.0-4gl0" "$arch"
91+
#
92+
# # Install edk2-cloud-hypervisor-gl package
93+
# install_package "edk2-cloud-hypervisor-gl" "gardenlinux/package-edk2-cloud-hypervisor-gl" "20250503-2gl0" "$arch"
94+
95+
# Install libvirt-daemon-driver-ch-gl package
96+
install_package "gardenlinux/package-libvirt" "11.3.0-11gl0" "$arch" libvirt-clients \
97+
libvirt-common \
98+
libvirt-daemon-common \
99+
libvirt-daemon-config-network \
100+
libvirt-daemon-config-nwfilter \
101+
libvirt-daemon-driver-ch-gl \
102+
libvirt-daemon-driver-network \
103+
libvirt-daemon-driver-nodedev \
104+
libvirt-daemon-driver-nwfilter \
105+
libvirt-daemon-driver-qemu \
106+
libvirt-daemon-driver-secret \
107+
libvirt-daemon-driver-storage \
108+
libvirt-daemon-log \
109+
libvirt-daemon-system \
110+
libvirt-daemon \
111+
libvirt0

features/sci/pkg.include

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cloud-hypervisor-gl
22
conntrack
33
edk2-cloud-hypervisor-gl
4-
libvirt-daemon-driver-ch-gl
54
multipath-tools
65
open-iscsi
76
openvswitch-switch

0 commit comments

Comments
 (0)