From 9b897b7925cb6004948b9b1edda2221018d02ef9ca16755ab6653f2ee414c049 Mon Sep 17 00:00:00 2001 From: Vasily Ulyanov Date: Tue, 18 Jan 2022 13:10:50 +0000 Subject: [PATCH] Accepting request 947114 from home:Guillaume_G:branches:Virtualization - Handle aarch64 - Enable build only on aarch64 and x86_64 OBS-URL: https://build.opensuse.org/request/show/947114 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-launcher-container?expand=0&rev=17 --- Dockerfile | 36 ++++++++++++++++++++++++++++----- virt-launcher-container.changes | 6 ++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36c8715..c5b4120 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,16 @@ #!BuildTag: %%TAGPREFIX%%/virt-launcher:%%PKG_VERSION%%.%RELEASE% #!BuildTag: %%TAGPREFIX%%/virt-launcher:%%PKG_VERSION%%-%%PKG_RELEASE%% +#!ExclusiveArch: x86_64 aarch64 + # virt-launcher container image # KUBEVIRTFROM defined in prjconf, e.g. # BuildFlags: dockerarg:KUBEVIRTFROM=opensuse/tumbleweed ARG KUBEVIRTFROM FROM $KUBEVIRTFROM +# TARGETARCH defined in prjconf, to handle architecture specific bits +# since TARGETARCH is not defined in OBS builds yet. +ARG TARGETARCH # labelprefix=%%LABELPREFIX%% PREFIXEDLABEL org.opencontainers.image.title="kubevirt virt-launcher container" @@ -29,21 +34,42 @@ RUN zypper -n install \ libvirt-daemon-qemu \ nftables \ qemu-tools \ - qemu-x86 \ socat \ tar \ timezone \ vim \ - xorriso && \ - zypper clean -a && \ + xorriso +#!ArchExclusiveLine: x86_64 +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + zypper -n install qemu-x86 ; \ + fi; + +#!ArchExclusiveLine: aarch64 +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + zypper -n install \ + qemu-arm \ + qemu-uefi-aarch64 ; \ + fi; + +RUN zypper clean -a && \ mkdir -p /usr/share/kubevirt/virt-launcher -RUN mkdir -p /usr/share/OVMF && \ +RUN mkdir -p /usr/share/OVMF + +#!ArchExclusiveLine: x86_64 +RUN if [ "$TARGETARCH" = "amd64" ]; then \ ln -s ../qemu/ovmf-x86_64-code.bin /usr/share/OVMF/OVMF_CODE.fd && \ ln -s ../qemu/ovmf-x86_64-vars.bin /usr/share/OVMF/OVMF_VARS.fd && \ ln -s ../qemu/ovmf-x86_64-code.bin /usr/share/OVMF/OVMF_CODE.cc.fd && \ ln -s ../qemu/ovmf-x86_64-smm-ms-code.bin /usr/share/OVMF/OVMF_CODE.secboot.fd && \ - ln -s ../qemu/ovmf-x86_64-smm-ms-vars.bin /usr/share/OVMF/OVMF_VARS.secboot.fd + ln -s ../qemu/ovmf-x86_64-smm-ms-vars.bin /usr/share/OVMF/OVMF_VARS.secboot.fd ; \ + fi; + +#!ArchExclusiveLine: aarch64 +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + ln -s ../qemu/aavmf-aarch64-code.bin /usr/share/OVMF/AAVMF_CODE.fd && \ + ln -s ../qemu/aavmf-aarch64-vars.bin /usr/share/OVMF/AAVMF_VARS.fd ; \ + fi; COPY augconf /augconf diff --git a/virt-launcher-container.changes b/virt-launcher-container.changes index e589269..8c318da 100644 --- a/virt-launcher-container.changes +++ b/virt-launcher-container.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 10 10:56:39 UTC 2022 - Guillaume GARDET + +- Handle aarch64 +- Enable build only on aarch64 and x86_64 + ------------------------------------------------------------------- Mon Jan 10 09:52:56 UTC 2022 - Vasily Ulyanov