SHA256
1
0
forked from pool/qemu

Accepting request 955391 from Virtualization

- Revert ea85e8bcd33af3bc4e7700526cc24e6c, as Factory can't be configured appropiately for it

OBS-URL: https://build.opensuse.org/request/show/955391
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=688
This commit is contained in:
Dario Faggioli 2022-02-16 14:35:22 +00:00 committed by Git OBS Bridge
parent 773567aa73
commit 238d8f5000
3 changed files with 314 additions and 329 deletions

View File

@ -1,18 +1,3 @@
-------------------------------------------------------------------
Sat Feb 5 14:27:32 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Binary firmwares are built from sources by default (and not only on
x86) and then "cross-imported" among builds for different arches. Of
course this requires, additionally to these changes, a proper project
setup (see prjconf). This fixes bsc#1193545.
* Build x86 firmwares only on x86 builds (i.e., stop cross building
them on ARM)
* Build x86 firmwares only once (during x86_64 builds only), instead
of twice (i.e., during both %ix86 and x86_64, as we're doing now))
* Always build PPC firmwares (only on PPC builds)
* Build PPC firmwares only once (during ppc64le builds only), instead
of twice (i.e., during both ppc64 and ppc64le, as we're doing now))
-------------------------------------------------------------------
Sun Jan 23 15:13:19 UTC 2022 - Li Zhang <li.zhang@suse.com>

316
qemu.spec
View File

@ -1,5 +1,5 @@
#
# spec file
# spec file for package qemu
#
# Copyright (c) 2022 SUSE LLC
#
@ -22,18 +22,37 @@
%define _buildshell /bin/bash
%define build_firmware_from_source 1
%define build_x86_firmware_from_source 0
%define build_skiboot_from_source 0
%define build_slof_from_source 0
%define build_opensbi_from_source 0
%define kvm_available 0
%define legacy_qemu_kvm 0
%define force_fit_virtio_pxe_rom 1
%define build_rom_arch %ix86 x86_64 aarch64
%if "%{?distribution}" == ""
%define distro private-build
%else
%define distro %{distribution}
%endif
%ifarch %{build_rom_arch}
# choice of building all from source or using provided binary x86 blobs
%define build_x86_firmware_from_source 1
%endif
%ifarch ppc64
%define build_skiboot_from_source 0
%define build_slof_from_source 1
%endif
%ifarch ppc64le
%define build_skiboot_from_source 0
%define build_slof_from_source 1
%endif
%ifarch riscv64
%define build_opensbi_from_source 1
%endif
@ -209,37 +228,47 @@ syscall layer occurs on the native hardware and operating system.
# above section is for qemu-linux-user
# ------------------------------------------------------------------------
%else
%if %{build_firmware_from_source}
%ifarch x86_64
%if %{build_x86_firmware_from_source}
BuildRequires: acpica
BuildRequires: binutils-devel
BuildRequires: dos2unix
BuildRequires: glibc-devel-32bit
BuildRequires: pkgconfig(liblzma)
%endif
BuildRequires: pkgconfig(alsa)
%if %{build_x86_firmware_from_source}
BuildRequires: binutils-devel
%endif
BuildRequires: bison
BuildRequires: brlapi-devel
%if %{build_x86_firmware_from_source}
%ifnarch %{ix86} x86_64
# We must cross-compile on non-x86*
BuildRequires: cross-x86_64-binutils
BuildRequires: cross-x86_64-gcc%gcc_version
%endif
%endif
BuildRequires: pkgconfig(libcurl) >= 7.29
BuildRequires: pkgconfig(libsasl2)
%if %{build_x86_firmware_from_source}
BuildRequires: dos2unix
%endif
BuildRequires: flex
BuildRequires: pkgconfig(glib-2.0) >= 2.56
%if %{build_x86_firmware_from_source}
BuildRequires: glibc-devel-32bit
%endif
BuildRequires: libaio-devel
BuildRequires: libattr-devel
BuildRequires: libbz2-devel
BuildRequires: libfdt-devel >= 1.4.2
BuildRequires: libgcrypt-devel >= 1.8.0
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(glib-2.0) >= 2.56
BuildRequires: pkgconfig(glusterfs-api) >= 3
BuildRequires: pkgconfig(gnutls) >= 3.5.18
BuildRequires: pkgconfig(gtk+-3.0) >= 3.22
BuildRequires: pkgconfig(libcacard) >= 2.5.1
BuildRequires: pkgconfig(libcap-ng)
BuildRequires: pkgconfig(libcurl) >= 7.29
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libiscsi) >= 1.9.0
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libsasl2)
%if 0%{?with_daxctl}
BuildRequires: pkgconfig(libndctl)
%endif
@ -291,6 +320,9 @@ BuildRequires: pkgconfig(vte-2.91)
BuildRequires: xen-devel >= 4.2
%endif
BuildRequires: xfsprogs-devel
%if %{build_x86_firmware_from_source}
BuildRequires: pkgconfig(liblzma)
%endif
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
%if "%{name}" == "qemu"
@ -399,7 +431,6 @@ Group: System/Emulators/PC
Version: %{qemuver}
Release: 0
Requires: %name = %{qemuver}
Requires: qemu-SLOF
Recommends: qemu-ipxe
Recommends: qemu-vgabios
@ -862,10 +893,7 @@ Supplements: modalias(pci:v0000FFFDd00000101sv*sd*bc*sc*i*)
This package contains the QEMU guest agent. It is installed in the linux guest
to provide information and control at the guest OS level.
%if %{build_firmware_from_source}
%ifarch x86_64
%ifarch %{build_rom_arch}
%package microvm
Summary: x86 MicroVM firmware for QEMU
Group: System/Emulators/PC
@ -879,12 +907,6 @@ QEMU. qboot provides the minimum resources needed to boot PVH and bzImages.
bios-microvm, created from a minimal seabios configuration, provides slightly
wider support than qboot, but still focuses on quick boot up.
%files microvm
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios-microvm.bin
%_datadir/%name/qboot.rom
%package seabios
Summary: x86 Legacy BIOS for QEMU
Group: System/Emulators/PC
@ -897,14 +919,6 @@ Conflicts: %name < 1.6.0
SeaBIOS is an open source implementation of a 16bit x86 BIOS. SeaBIOS
is the default and legacy BIOS for QEMU.
%files seabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios.bin
%_datadir/%name/bios-256k.bin
%_datadir/%name/firmware/50-seabios-256k.json
%_datadir/%name/firmware/60-seabios-128k.json
%package vgabios
Summary: VGA BIOSes for QEMU
Group: System/Emulators/PC
@ -926,29 +940,11 @@ Release: 0
BuildArch: noarch
Conflicts: %name < 1.6.0
%files vgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/vgabios.bin
%_datadir/%name/vgabios-ati.bin
%_datadir/%name/vgabios-bochs-display.bin
%_datadir/%name/vgabios-cirrus.bin
%_datadir/%name/vgabios-qxl.bin
%_datadir/%name/vgabios-ramfb.bin
%_datadir/%name/vgabios-stdvga.bin
%_datadir/%name/vgabios-virtio.bin
%_datadir/%name/vgabios-vmware.bin
%description sgabios
The Google Serial Graphics Adapter BIOS or SGABIOS provides a means for legacy
x86 software to communicate with an attached serial console as if a video card
were attached. For use with QEMU.
%files sgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/sgabios.bin
%package ipxe
Summary: PXE ROMs for QEMU NICs
Group: System/Emulators/PC
@ -960,27 +956,7 @@ Conflicts: %name < 1.6.0
%description ipxe
Provides Preboot Execution Environment (PXE) ROM support for various emulated
network adapters available with QEMU.
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
%_datadir/%name/efi-ne2k_pci.rom
%_datadir/%name/efi-pcnet.rom
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%endif
%ifarch ppc64le
%package skiboot
Summary: OPAL firmware (aka skiboot), used in booting OpenPOWER systems
@ -996,35 +972,6 @@ Provides: %name:%_datadir/%name/forsplits/06
Provides OPAL (OpenPower Abstraction Layer) firmware, aka skiboot, as
traditionally packaged with QEMU.
%files skiboot
%defattr(-, root, root)
%dir %_datadir/%name
%dir %_datadir/%name/forsplits
%_datadir/%name/forsplits/06
%_datadir/%name/skiboot.lid
%_datadir/%name/skiboot.lid.qemu
%ghost %_sysconfdir/alternatives/skiboot.lid
%package SLOF
Summary: Slimline Open Firmware (SLOF)
Group: System/Emulators/PC
Version: %{qemuver}
Release: 0
BuildArch: noarch
%description SLOF
SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware implementation
for certain IBM POWER hardware. The sources are at https://github.com/aik/SLOF.
%files SLOF
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/slof.bin
%endif
%endif
%package ksm
Summary: Kernel Samepage Merging services
Group: System/Emulators/PC
@ -1084,7 +1031,6 @@ BuildRequires: qemu-block-nfs = %{qemuver}
%if 0%{?with_rbd}
BuildRequires: qemu-block-rbd = %{qemuver}
%endif
BuildRequires: qemu-SLOF = %{qemuver}
BuildRequires: qemu-accel-qtest = %{qemuver}
BuildRequires: qemu-accel-tcg-x86 = %{qemuver}
BuildRequires: qemu-block-ssh = %{qemuver}
@ -1236,6 +1182,16 @@ efi-vmxnet3.rom}
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
@ -1252,17 +1208,16 @@ efi-vmxnet3.rom}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch x86_64
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%if %{build_firmware_from_source}
%ifarch ppc64le
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%endif
%ifarch x86_64
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
@ -1504,14 +1459,11 @@ cd %blddir
%if "%{name}" == "qemu"
# If we're building the firmware from sources, delete the upstream provided
# binaries of the specific firmwares that we will build in this instance.
%if %{build_firmware_from_source}
# delete the firmware files that we intend to build
for i in %built_firmware
do
unlink %srcdir/pc-bios/$i
done
%endif
make %{?_smp_mflags} V=1
@ -1531,7 +1483,7 @@ do
done
%endif
%ifarch x86_64
%ifarch %ix86 x86_64
for i in %x86_default_built_firmware
do
cp pc-bios/optionrom/$i %srcdir/pc-bios/
@ -1544,18 +1496,29 @@ done
%endif
%endif
%if %{build_firmware_from_source}
%ifarch x86_64
%if %{build_x86_firmware_from_source}
%ifnarch %{ix86} x86_64
export CC=x86_64-suse-linux-gcc
export LD=x86_64-suse-linux-ld
%endif
make %{?_smp_mflags} -C %srcdir/roms bios \
SEABIOS_EXTRAVERSION="-rebuilt.opensuse.org"
SEABIOS_EXTRAVERSION="-rebuilt.opensuse.org" \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms qboot
make %{?_smp_mflags} -C %srcdir/roms seavgabios
make %{?_smp_mflags} -C %srcdir/roms seavgabios \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms seavgabios-ati
make %{?_smp_mflags} -C %srcdir/roms seavgabios-ati \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms pxerom
@ -1600,16 +1563,18 @@ for i in %supported_nics_small
exit 1
fi
done
%ifnarch %{ix86} x86_64
unset CC
unset LD
%endif
%endif
%ifarch ppc64le
make %{?_smp_mflags} -C %srcdir/roms skiboot
%if %{build_skiboot_from_source}
make %{?_smp_mflags} -C %srcdir/roms skiboot CROSS=
%endif
%if %{build_slof_from_source}
make %{?_smp_mflags} -C %srcdir/roms slof
%endif
%endif
%if %{build_opensbi_from_source}
@ -1769,34 +1734,15 @@ ln -s qemu-binfmt %{buildroot}%_bindir/qemu-xtensaeb-binfmt
%if "%{name}" == "qemu"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
# At this point, all firmware files have been installed. If we build them, we've
# installed the binaries that have been built; if we don't, we've installed the
# binaries that upstream provides.
#
# In any case, if we are building on an arch for which we don't create (some
# of) the firmware packages, we need to remove the binaries that would go in
# such packages. E.g. if we are not on x86_64, we are not building the x86
# firmware and we are not creating the x86 firmware packages. We, therefore,
# need to remove the upstream fimrware binaries that have been installed in
# the {buildroot} by `make install`, but wouldn't be included in any package.
%ifnarch x86_64
%ifarch %{build_rom_arch}
install -D -m 0644 %{SOURCE14} %{buildroot}%_datadir/%name/firmware/50-seabios-256k.json
install -D -m 0644 %{SOURCE15} %{buildroot}%_datadir/%name/firmware/60-seabios-128k.json
%else
for f in %{x86_extra_firmware} \
%{x86_64_only_extra_firmware}; do
unlink %{buildroot}%_datadir/%name/$f
done
%endif
%ifnarch ppc64le
for f in %{ppc_extra_firmware} \
%{ppc64_only_extra_firmware}; do
unlink %{buildroot}%_datadir/%name/$f
done
%endif
%ifarch x86_64
install -D -m 0644 %{SOURCE14} %{buildroot}%_datadir/%name/firmware/50-seabios-256k.json
install -D -m 0644 %{SOURCE15} %{buildroot}%_datadir/%name/firmware/60-seabios-128k.json
%endif
%find_lang %name
install -d -m 0755 %{buildroot}%_datadir/%name/firmware
install -d -m 0755 %{buildroot}/usr/lib/supportconfig/plugins
@ -1853,21 +1799,17 @@ unlink %{buildroot}%_datadir/%name/edk2-x86_64-secure-code.fd
# this was never meant for customer consumption - delete even though installed
unlink %{buildroot}%_bindir/elf2dmp
install -D -m 0644 %{SOURCE201} %{buildroot}%_datadir/%name/forsplits/pkg-split.txt
for X in 00 01 02 03 04 05 07 08 09 10 11 12 13 14 15 16 17 18 19
do
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/$X
done
%ifarch ppc64le
# in support of update-alternatives
mv %{buildroot}%_datadir/%name/skiboot.lid %{buildroot}%_datadir/%name/skiboot.lid.qemu
# create a dummy target for /etc/alternatives/skiboot.lid
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/skiboot.lid %{buildroot}%{_datadir}/%name/skiboot.lid
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/06
%endif
install -D -m 0644 %{SOURCE201} %{buildroot}%_datadir/%name/forsplits/pkg-split.txt
for X in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
do
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/$X
done
%suse_update_desktop_file qemu
%fdupes -s %{buildroot}
@ -1932,8 +1874,6 @@ fi
%postun ksm
%service_del_postun ksm.service
%if %{build_firmware_from_source}
%ifarch ppc64le
%post skiboot
update-alternatives --install \
%{_datadir}/%name/skiboot.lid skiboot.lid %{_datadir}/%name/skiboot.lid.qemu 15
@ -1942,8 +1882,6 @@ update-alternatives --install \
if [ ! -f %{_datadir}/%name/skiboot.lid.qemu ] ; then
update-alternatives --remove skiboot.lid %{_datadir}/%name/skiboot.lid.qemu
fi
%endif
%endif
# above section is for qemu
%endif
@ -2230,6 +2168,7 @@ fi
%_datadir/%name/canyonlands.dtb
%_datadir/%name/openbios-ppc
%_datadir/%name/qemu_vga.ndrv
%_datadir/%name/slof.bin
%_datadir/%name/u-boot.e500
%_datadir/%name/u-boot-sam460-20100605.bin
%dir %_docdir/qemu-ppc
@ -2481,6 +2420,67 @@ fi
%files lang -f %blddir/%name.lang
%defattr(-, root, root)
%ifarch %{build_rom_arch}
%files seabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios.bin
%_datadir/%name/bios-256k.bin
%_datadir/%name/firmware/50-seabios-256k.json
%_datadir/%name/firmware/60-seabios-128k.json
%files microvm
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios-microvm.bin
%_datadir/%name/qboot.rom
%files vgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/vgabios.bin
%_datadir/%name/vgabios-ati.bin
%_datadir/%name/vgabios-bochs-display.bin
%_datadir/%name/vgabios-cirrus.bin
%_datadir/%name/vgabios-qxl.bin
%_datadir/%name/vgabios-ramfb.bin
%_datadir/%name/vgabios-stdvga.bin
%_datadir/%name/vgabios-virtio.bin
%_datadir/%name/vgabios-vmware.bin
%files sgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/sgabios.bin
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
%_datadir/%name/efi-ne2k_pci.rom
%_datadir/%name/efi-pcnet.rom
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%endif
%files skiboot
%defattr(-, root, root)
%dir %_datadir/%name
%dir %_datadir/%name/forsplits
%_datadir/%name/forsplits/06
%_datadir/%name/skiboot.lid
%_datadir/%name/skiboot.lid.qemu
%ghost %_sysconfdir/alternatives/skiboot.lid
%files vhost-user-gpu
%defattr(-, root, root)
%dir %_datadir/%name/vhost-user

View File

@ -1,7 +1,7 @@
#
# spec file
# spec file for package qemu
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -22,18 +22,37 @@
%define _buildshell /bin/bash
%define build_firmware_from_source 1
%define build_x86_firmware_from_source 0
%define build_skiboot_from_source 0
%define build_slof_from_source 0
%define build_opensbi_from_source 0
%define kvm_available 0
%define legacy_qemu_kvm 0
%define force_fit_virtio_pxe_rom 1
%define build_rom_arch %ix86 x86_64 aarch64
%if "%{?distribution}" == ""
%define distro private-build
%else
%define distro %{distribution}
%endif
%ifarch %{build_rom_arch}
# choice of building all from source or using provided binary x86 blobs
%define build_x86_firmware_from_source 1
%endif
%ifarch ppc64
%define build_skiboot_from_source 0
%define build_slof_from_source 1
%endif
%ifarch ppc64le
%define build_skiboot_from_source 0
%define build_slof_from_source 1
%endif
%ifarch riscv64
%define build_opensbi_from_source 1
%endif
@ -141,22 +160,32 @@ syscall layer occurs on the native hardware and operating system.
# above section is for qemu-linux-user
# ------------------------------------------------------------------------
%else
%if %{build_firmware_from_source}
%ifarch x86_64
%if %{build_x86_firmware_from_source}
BuildRequires: acpica
BuildRequires: binutils-devel
BuildRequires: dos2unix
BuildRequires: glibc-devel-32bit
BuildRequires: pkgconfig(liblzma)
%endif
%endif
BuildRequires: pkgconfig(alsa)
%if %{build_x86_firmware_from_source}
BuildRequires: binutils-devel
%endif
BuildRequires: bison
BuildRequires: brlapi-devel
%if %{build_x86_firmware_from_source}
%ifnarch %{ix86} x86_64
# We must cross-compile on non-x86*
BuildRequires: cross-x86_64-binutils
BuildRequires: cross-x86_64-gcc%gcc_version
%endif
%endif
BuildRequires: pkgconfig(libcurl) >= 7.29
BuildRequires: pkgconfig(libsasl2)
%if %{build_x86_firmware_from_source}
BuildRequires: dos2unix
%endif
BuildRequires: flex
BuildRequires: pkgconfig(glib-2.0) >= 2.56
%if %{build_x86_firmware_from_source}
BuildRequires: glibc-devel-32bit
%endif
BuildRequires: libaio-devel
BuildRequires: libattr-devel
BuildRequires: libbz2-devel
@ -223,6 +252,9 @@ BuildRequires: pkgconfig(vte-2.91)
BuildRequires: xen-devel >= 4.2
%endif
BuildRequires: xfsprogs-devel
%if %{build_x86_firmware_from_source}
BuildRequires: pkgconfig(liblzma)
%endif
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libzstd)
%if "%{name}" == "qemu"
@ -331,7 +363,6 @@ Group: System/Emulators/PC
Version: %{qemuver}
Release: 0
Requires: %name = %{qemuver}
Requires: qemu-SLOF
Recommends: qemu-ipxe
Recommends: qemu-vgabios
@ -794,10 +825,7 @@ Supplements: modalias(pci:v0000FFFDd00000101sv*sd*bc*sc*i*)
This package contains the QEMU guest agent. It is installed in the linux guest
to provide information and control at the guest OS level.
%if %{build_firmware_from_source}
%ifarch x86_64
%ifarch %{build_rom_arch}
%package microvm
Summary: x86 MicroVM firmware for QEMU
Group: System/Emulators/PC
@ -811,12 +839,6 @@ QEMU. qboot provides the minimum resources needed to boot PVH and bzImages.
bios-microvm, created from a minimal seabios configuration, provides slightly
wider support than qboot, but still focuses on quick boot up.
%files microvm
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios-microvm.bin
%_datadir/%name/qboot.rom
%package seabios
Summary: x86 Legacy BIOS for QEMU
Group: System/Emulators/PC
@ -829,14 +851,6 @@ Conflicts: %name < 1.6.0
SeaBIOS is an open source implementation of a 16bit x86 BIOS. SeaBIOS
is the default and legacy BIOS for QEMU.
%files seabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios.bin
%_datadir/%name/bios-256k.bin
%_datadir/%name/firmware/50-seabios-256k.json
%_datadir/%name/firmware/60-seabios-128k.json
%package vgabios
Summary: VGA BIOSes for QEMU
Group: System/Emulators/PC
@ -858,29 +872,11 @@ Release: 0
BuildArch: noarch
Conflicts: %name < 1.6.0
%files vgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/vgabios.bin
%_datadir/%name/vgabios-ati.bin
%_datadir/%name/vgabios-bochs-display.bin
%_datadir/%name/vgabios-cirrus.bin
%_datadir/%name/vgabios-qxl.bin
%_datadir/%name/vgabios-ramfb.bin
%_datadir/%name/vgabios-stdvga.bin
%_datadir/%name/vgabios-virtio.bin
%_datadir/%name/vgabios-vmware.bin
%description sgabios
The Google Serial Graphics Adapter BIOS or SGABIOS provides a means for legacy
x86 software to communicate with an attached serial console as if a video card
were attached. For use with QEMU.
%files sgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/sgabios.bin
%package ipxe
Summary: PXE ROMs for QEMU NICs
Group: System/Emulators/PC
@ -892,27 +888,7 @@ Conflicts: %name < 1.6.0
%description ipxe
Provides Preboot Execution Environment (PXE) ROM support for various emulated
network adapters available with QEMU.
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
%_datadir/%name/efi-ne2k_pci.rom
%_datadir/%name/efi-pcnet.rom
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%endif
%ifarch ppc64le
%package skiboot
Summary: OPAL firmware (aka skiboot), used in booting OpenPOWER systems
@ -928,35 +904,6 @@ Provides: %name:%_datadir/%name/forsplits/06
Provides OPAL (OpenPower Abstraction Layer) firmware, aka skiboot, as
traditionally packaged with QEMU.
%files skiboot
%defattr(-, root, root)
%dir %_datadir/%name
%dir %_datadir/%name/forsplits
%_datadir/%name/forsplits/06
%_datadir/%name/skiboot.lid
%_datadir/%name/skiboot.lid.qemu
%ghost %_sysconfdir/alternatives/skiboot.lid
%package SLOF
Summary: Slimline Open Firmware (SLOF)
Group: System/Emulators/PC
Version: %{qemuver}
Release: 0
BuildArch: noarch
%description SLOF
SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware implementation
for certain IBM POWER hardware. The sources are at https://github.com/aik/SLOF.
%files SLOF
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/slof.bin
%endif
%endif
%package ksm
Summary: Kernel Samepage Merging services
Group: System/Emulators/PC
@ -1037,7 +984,6 @@ BuildRequires: qemu-s390x = %{qemuver}
BuildRequires: qemu-seabios = %{sbver}
BuildRequires: qemu-sgabios = 8
BuildRequires: qemu-skiboot = %{qemuver}
BuildRequires: qemu-SLOF = %{qemuver}
BuildRequires: qemu-tools = %{qemuver}
BuildRequires: qemu-ui-curses = %{qemuver}
BuildRequires: qemu-ui-gtk = %{qemuver}
@ -1101,6 +1047,16 @@ efi-vmxnet3.rom}
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
@ -1117,17 +1073,16 @@ efi-vmxnet3.rom}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch x86_64
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%if %{build_firmware_from_source}
%ifarch ppc64le
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%endif
%ifarch x86_64
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
@ -1369,14 +1324,11 @@ cd %blddir
%if "%{name}" == "qemu"
# If we're building the firmware from sources, delete the upstream provided
# binaries of the specific firmwares that we will build in this instance.
%if %{build_firmware_from_source}
# delete the firmware files that we intend to build
for i in %built_firmware
do
unlink %srcdir/pc-bios/$i
done
%endif
make %{?_smp_mflags} V=1
@ -1396,7 +1348,7 @@ do
done
%endif
%ifarch x86_64
%ifarch %ix86 x86_64
for i in %x86_default_built_firmware
do
cp pc-bios/optionrom/$i %srcdir/pc-bios/
@ -1409,18 +1361,29 @@ done
%endif
%endif
%if %{build_firmware_from_source}
%ifarch x86_64
%if %{build_x86_firmware_from_source}
%ifnarch %{ix86} x86_64
export CC=x86_64-suse-linux-gcc
export LD=x86_64-suse-linux-ld
%endif
make %{?_smp_mflags} -C %srcdir/roms bios \
SEABIOS_EXTRAVERSION="-rebuilt.opensuse.org"
SEABIOS_EXTRAVERSION="-rebuilt.opensuse.org" \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms qboot
make %{?_smp_mflags} -C %srcdir/roms seavgabios
make %{?_smp_mflags} -C %srcdir/roms seavgabios \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms seavgabios-ati
make %{?_smp_mflags} -C %srcdir/roms seavgabios-ati \
%ifnarch %ix86 x86_64
HOSTCC=cc \
%endif
make %{?_smp_mflags} -C %srcdir/roms pxerom
@ -1465,16 +1428,18 @@ for i in %supported_nics_small
exit 1
fi
done
%ifnarch %{ix86} x86_64
unset CC
unset LD
%endif
%endif
%ifarch ppc64le
make %{?_smp_mflags} -C %srcdir/roms skiboot
%if %{build_skiboot_from_source}
make %{?_smp_mflags} -C %srcdir/roms skiboot CROSS=
%endif
%if %{build_slof_from_source}
make %{?_smp_mflags} -C %srcdir/roms slof
%endif
%endif
%if %{build_opensbi_from_source}
@ -1634,34 +1599,15 @@ ln -s qemu-binfmt %{buildroot}%_bindir/qemu-xtensaeb-binfmt
%if "%{name}" == "qemu"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
# At this point, all firmware files have been installed. If we build them, we've
# installed the binaries that have been built; if we don't, we've installed the
# binaries that upstream provides.
#
# In any case, if we are building on an arch for which we don't create (some
# of) the firmware packages, we need to remove the binaries that would go in
# such packages. E.g. if we are not on x86_64, we are not building the x86
# firmware and we are not creating the x86 firmware packages. We, therefore,
# need to remove the upstream fimrware binaries that have been installed in
# the {buildroot} by `make install`, but wouldn't be included in any package.
%ifnarch x86_64
%ifarch %{build_rom_arch}
install -D -m 0644 %{SOURCE14} %{buildroot}%_datadir/%name/firmware/50-seabios-256k.json
install -D -m 0644 %{SOURCE15} %{buildroot}%_datadir/%name/firmware/60-seabios-128k.json
%else
for f in %{x86_extra_firmware} \
%{x86_64_only_extra_firmware}; do
unlink %{buildroot}%_datadir/%name/$f
done
%endif
%ifnarch ppc64le
for f in %{ppc_extra_firmware} \
%{ppc64_only_extra_firmware}; do
unlink %{buildroot}%_datadir/%name/$f
done
%endif
%ifarch x86_64
install -D -m 0644 %{SOURCE14} %{buildroot}%_datadir/%name/firmware/50-seabios-256k.json
install -D -m 0644 %{SOURCE15} %{buildroot}%_datadir/%name/firmware/60-seabios-128k.json
%endif
%find_lang %name
install -d -m 0755 %{buildroot}%_datadir/%name/firmware
install -d -m 0755 %{buildroot}/usr/lib/supportconfig/plugins
@ -1718,21 +1664,17 @@ unlink %{buildroot}%_datadir/%name/edk2-x86_64-secure-code.fd
# this was never meant for customer consumption - delete even though installed
unlink %{buildroot}%_bindir/elf2dmp
install -D -m 0644 %{SOURCE201} %{buildroot}%_datadir/%name/forsplits/pkg-split.txt
for X in 00 01 02 03 04 05 07 08 09 10 11 12 13 14 15 16 17 18 19
do
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/$X
done
%ifarch ppc64le
# in support of update-alternatives
mv %{buildroot}%_datadir/%name/skiboot.lid %{buildroot}%_datadir/%name/skiboot.lid.qemu
# create a dummy target for /etc/alternatives/skiboot.lid
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/skiboot.lid %{buildroot}%{_datadir}/%name/skiboot.lid
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/06
%endif
install -D -m 0644 %{SOURCE201} %{buildroot}%_datadir/%name/forsplits/pkg-split.txt
for X in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
do
ln -s pkg-split.txt %{buildroot}%_datadir/%name/forsplits/$X
done
%suse_update_desktop_file qemu
%fdupes -s %{buildroot}
@ -1797,8 +1739,6 @@ fi
%postun ksm
%service_del_postun ksm.service
%if %{build_firmware_from_source}
%ifarch ppc64le
%post skiboot
update-alternatives --install \
%{_datadir}/%name/skiboot.lid skiboot.lid %{_datadir}/%name/skiboot.lid.qemu 15
@ -1807,8 +1747,6 @@ update-alternatives --install \
if [ ! -f %{_datadir}/%name/skiboot.lid.qemu ] ; then
update-alternatives --remove skiboot.lid %{_datadir}/%name/skiboot.lid.qemu
fi
%endif
%endif
# above section is for qemu
%endif
@ -2095,6 +2033,7 @@ fi
%_datadir/%name/canyonlands.dtb
%_datadir/%name/openbios-ppc
%_datadir/%name/qemu_vga.ndrv
%_datadir/%name/slof.bin
%_datadir/%name/u-boot.e500
%_datadir/%name/u-boot-sam460-20100605.bin
%dir %_docdir/qemu-ppc
@ -2346,6 +2285,67 @@ fi
%files lang -f %blddir/%name.lang
%defattr(-, root, root)
%ifarch %{build_rom_arch}
%files seabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios.bin
%_datadir/%name/bios-256k.bin
%_datadir/%name/firmware/50-seabios-256k.json
%_datadir/%name/firmware/60-seabios-128k.json
%files microvm
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/bios-microvm.bin
%_datadir/%name/qboot.rom
%files vgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/vgabios.bin
%_datadir/%name/vgabios-ati.bin
%_datadir/%name/vgabios-bochs-display.bin
%_datadir/%name/vgabios-cirrus.bin
%_datadir/%name/vgabios-qxl.bin
%_datadir/%name/vgabios-ramfb.bin
%_datadir/%name/vgabios-stdvga.bin
%_datadir/%name/vgabios-virtio.bin
%_datadir/%name/vgabios-vmware.bin
%files sgabios
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/sgabios.bin
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
%_datadir/%name/efi-ne2k_pci.rom
%_datadir/%name/efi-pcnet.rom
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%endif
%files skiboot
%defattr(-, root, root)
%dir %_datadir/%name
%dir %_datadir/%name/forsplits
%_datadir/%name/forsplits/06
%_datadir/%name/skiboot.lid
%_datadir/%name/skiboot.lid.qemu
%ghost %_sysconfdir/alternatives/skiboot.lid
%files vhost-user-gpu
%defattr(-, root, root)
%dir %_datadir/%name/vhost-user