From 28c68d979a47b2cccb1b23c2dfd6d5a529df9a3de7b51ec1c31bee34754bb4a1 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 1 Jun 2021 20:33:53 +0000 Subject: [PATCH] Accepting request 896676 from home:cyphar:lxc - Fix build on i586 by if_arch-ing out the VM support on non-x86_64 platforms. OBS-URL: https://build.opensuse.org/request/show/896676 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=90 --- lxd.changes | 5 +++++ lxd.spec | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lxd.changes b/lxd.changes index b678aab..2717a0e 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 1 11:57:52 UTC 2021 - Aleksa Sarai + +- Fix build on i586 by if_arch-ing out the VM support on non-x86_64 platforms. + ------------------------------------------------------------------- Mon May 31 05:11:38 UTC 2021 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 08c1fe0..4ad6224 100644 --- a/lxd.spec +++ b/lxd.spec @@ -25,6 +25,14 @@ %define lxd_datadir %{_datadir}/lxd %define lxd_ovmfdir %{lxd_datadir}/ovmf +# We need OVMF in order to support VMs with LXD. At the moment this means we +# can only support it on x86_64. +%ifarch x86_64 +%define arch_vm_support 1 +%else +%define arch_vm_support 0 +%endif + Name: lxd Version: 4.14 Release: 0 @@ -72,6 +80,7 @@ Requires: rsync Requires: squashfs Requires: tar Requires: xz +%if 0%{arch_vm_support} != 0 # Needed for VM support. Requires: qemu-ovmf-x86_64 BuildRequires: qemu-ovmf-x86_64 @@ -82,7 +91,9 @@ Requires: qemu-ui-spice-core %else Requires: qemu-ui-spice-app %endif +# TODO: SHould we make this architecture-specific? Requires: qemu-x86 +%endif # Storage backends -- we don't recommend ZFS since it's not *technically* a # blessed configuration. Recommends: lvm2 @@ -309,6 +320,7 @@ install -D -m 0644 %{S:201} %{buildroot}%{_sysconfdir}/dnsmasq.d/60-lxd.conf install -d -m 0711 %{buildroot}%{_localstatedir}/lib/%{name} install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} +%if 0%{arch_vm_support} != 0 # In order for VM support in LXD to function, you need to have OVMF configured # in the way it expects. In particular, LXD depends on specific filenames for # the firmware files so we create fake ones with symlinks. @@ -316,6 +328,7 @@ mkdir -p %{buildroot}%{lxd_ovmfdir} ln -s %{_datarootdir}/qemu/ovmf-x86_64-code.bin %{buildroot}%{lxd_ovmfdir}/OVMF_CODE.fd ln -s %{_datarootdir}/qemu/ovmf-x86_64-vars.bin %{buildroot}%{lxd_ovmfdir}/OVMF_VARS.fd ln -s OVMF_VARS.fd %{buildroot}%{lxd_ovmfdir}/OVMF_VARS.ms.fd +%endif %fdupes %{buildroot} @@ -373,7 +386,9 @@ grep -q '^root:' /etc/subgid || \ %config(noreplace) /etc/lxd/config.yml %dir /etc/lxd/servercerts +%if 0%{arch_vm_support} != 0 %{lxd_datadir} +%endif %{_sbindir}/rc%{name} %{_unitdir}/%{name}.service