%if !0%{?rhel} %global qemu_bin qemu-system-aarch64 %else %global qemu_bin qemu-kvm %endif Name: autosig-qemu-dtb Version: 0.1 Release: 4%{?dist} Summary: Dtb for qemu # This is the qemu licences. Don't know what the actual output file license really is License: GPLv2 and BSD and MIT and CC-BY BuildRequires: qemu-kvm autosig-u-boot # No dtbs in x86-land so it makes sense ExclusiveArch: aarch64 %global with_kvm 0 %description Create dtb for use with aarch64 qemu, in combination with autosig-u-boot firmware. %prep rm -rf %{name}-{%version} mkdir %{name}-{%version} %build cd %{name}-{%version} export PATH=$PATH:/usr/libexec %if 0%{?with_kvm} # check if kvm exists, if it doesn't, the environment isn't suitable to dump # kvm dtbs, cbs is not kvm enabled, so it cannot generate dtbs that work with # kvm guest [ -e "/dev/kvm" ] %{qemu_bin} -smp 1 -machine virt,accel=kvm -m 4G -cpu max -bios /boot/u-boot.bin -machine dumpdtb=qemu-kvm.dtb %endif %{qemu_bin} -smp 1 -machine virt,accel=tcg -m 4G -cpu max -bios /boot/u-boot.bin -machine dumpdtb=qemu-tcg.dtb %install cd %{name}-{%version} %if 0%{?with_kvm} install -Dm 0644 qemu-kvm.dtb %{buildroot}%{_datadir}/qemu/qemu-kvm.dtb %endif install -Dm 0644 qemu-tcg.dtb %{buildroot}%{_datadir}/qemu/qemu-tcg.dtb %files %if 0%{?with_kvm} %{_datadir}/qemu/qemu-kvm.dtb %endif %{_datadir}/qemu/qemu-tcg.dtb %changelog * Mon Mar 13 2023 Eric Curtin - Dump only tcg dtb. There's a with_kvm flag you can flip if you want to build. * Wed Jan 11 2023 Eric Curtin - Install dtbs to /usr/share/qemu/ to be ostree compatible - Dump both tcg and kvm dtbs * Wed Aug 17 2022 Alexander Larsson - Initial version