From facaf4d6082c2e637fa49d10856eaa3a0f590d08 Mon Sep 17 00:00:00 2001 From: xianglai li Date: Mon, 15 Jan 2024 03:32:46 -0500 Subject: [PATCH] Change the bios name for loongarch. The bios name Settings on loongarch are incorrect and need to be renamed. At the same time, add the qemu-kvm file to the /usr/libexec directory. Signed-off-by: xianglai li --- Change-the-bios-name-for-loongarch.patch | 42 ++++++++++++++++++ ...-loongarch64-code.fd => loongarch_bios.bin | Bin ...-loongarch64-vars.fd => loongarch_vars.bin | Bin qemu.spec | 35 ++++++++++----- 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 Change-the-bios-name-for-loongarch.patch rename edk2-loongarch64-code.fd => loongarch_bios.bin (100%) rename edk2-loongarch64-vars.fd => loongarch_vars.bin (100%) diff --git a/Change-the-bios-name-for-loongarch.patch b/Change-the-bios-name-for-loongarch.patch new file mode 100644 index 0000000..51853e2 --- /dev/null +++ b/Change-the-bios-name-for-loongarch.patch @@ -0,0 +1,42 @@ +From eaa92e83cc4999b8550ccdf66ba2f828f7030a29 Mon Sep 17 00:00:00 2001 +From: xianglai li +Date: Mon, 15 Jan 2024 03:25:38 -0500 +Subject: [PATCH] Change the bios name for loongarch. + +The bios name Settings on loongarch are incorrect and need to be +renamed. + +Signed-off-by: xianglai li +--- + include/hw/loongarch/bios.h | 2 +- + pc-bios/meson.build | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/hw/loongarch/bios.h b/include/hw/loongarch/bios.h +index 2bb1d560e..3677303bf 100644 +--- a/include/hw/loongarch/bios.h ++++ b/include/hw/loongarch/bios.h +@@ -2,4 +2,4 @@ + #include "cpu.h" + + #define BIOS_SIZE (4 * MiB) +-#define BIOS_FILENAME "edk2-loongarch64-code.fd" ++#define BIOS_FILENAME "loongarch_bios.bin" +diff --git a/pc-bios/meson.build b/pc-bios/meson.build +index c9a1972b1..60009bd89 100644 +--- a/pc-bios/meson.build ++++ b/pc-bios/meson.build +@@ -83,8 +83,8 @@ blobs = files( + 'opensbi-riscv32-generic-fw_dynamic.elf', + 'opensbi-riscv64-generic-fw_dynamic.elf', + 'npcm7xx_bootrom.bin', +- 'edk2-loongarch64-code.fd', +- 'edk2-loongarch64-vars.fd', ++ 'loongarch_bios.bin', ++ 'loongarch_vars.bin', + ) + + if get_option('install_blobs') +-- +2.27.0 + diff --git a/edk2-loongarch64-code.fd b/loongarch_bios.bin similarity index 100% rename from edk2-loongarch64-code.fd rename to loongarch_bios.bin diff --git a/edk2-loongarch64-vars.fd b/loongarch_vars.bin similarity index 100% rename from edk2-loongarch64-vars.fd rename to loongarch_vars.bin diff --git a/qemu.spec b/qemu.spec index de52e90..fbdc5aa 100644 --- a/qemu.spec +++ b/qemu.spec @@ -20,6 +20,7 @@ %endif %ifarch loongarch64 %global kvm_package system-loongarch64 +%global need_qemu_kvm 1 %endif %global tools_only 0 @@ -204,7 +205,7 @@ Obsoletes: %{name}-system-moxie-core <= %{epoch}:%{version}-%{release} \ Obsoletes: %{name}-system-unicore32 <= %{epoch}:%{version}-%{release} \ Obsoletes: %{name}-system-unicore32-core <= %{epoch}:%{version}-%{release} -%define anolis_release 4 +%define anolis_release 5 Summary: QEMU is a FAST! processor emulator Name: qemu @@ -232,8 +233,8 @@ Source36: README.tests %global modprobe_kvm_conf %{SOURCE31} %endif -Source41: edk2-loongarch64-code.fd -Source42: edk2-loongarch64-vars.fd +Source41: loongarch_bios.bin +Source42: loongarch_vars.bin Patch0001: 0001-sgx-stub-fix.patch @@ -266,6 +267,7 @@ Patch1023: Modify-the-ioctl-command-of-kvm.patch Patch1024: Fixed-the-issue-where-qemu-specifies-the-boot-order.patch Patch1025: Fixed-a-compilation-error-caused-by-an-excessively-h.patch Patch1026: Delete-the-default-vga-graphics-card.patch +Patch1027: Change-the-bios-name-for-loongarch.patch BuildRequires: meson >= %{meson_version} BuildRequires: zlib-devel @@ -1616,9 +1618,9 @@ rm -rf %{buildroot}%{_datadir}/%{name}/sgabios.bin rm -rf %{buildroot}%{_datadir}/%{name}/edk2* rm -rf %{buildroot}%{_datadir}/%{name}/firmware -%ifarch loongarch64 -cp -f %{SOURCE41} %{buildroot}%{_datadir}/%{name}/edk2-loongarch64-code.fd -cp -f %{SOURCE42} %{buildroot}%{_datadir}/%{name}/edk2-loongarch64-vars.fd +%ifnarch loongarch64 +rm -f %{buildroot}%{_datadir}/%{name}/loongarch_bios.bin +rm -f %{buildroot}%{_datadir}/%{name}/loongarch_vars.bin %endif # Fedora specific stuff below @@ -1633,9 +1635,17 @@ for emu in %{buildroot}%{_bindir}/qemu-system-*; do # Install kvm specific source bits, and qemu-kvm manpage %if %{need_qemu_kvm} ln -sf qemu.1.gz %{buildroot}%{_mandir}/man1/qemu-kvm.1.gz + +%ifarch x86_64 ln -sf qemu-system-x86_64 %{buildroot}%{_bindir}/qemu-kvm %endif +%ifarch loongarch64 +cp %{buildroot}%{_bindir}/qemu-system-loongarch64 %{buildroot}%{_libexecdir}/qemu-kvm +%endif + +%endif + %ifnarch loongarch64 # Install binfmt @@ -2172,10 +2182,12 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %{_datadir}/%{name}/multiboot_dma.bin %{_datadir}/%{name}/pvh.bin %{_datadir}/%{name}/qboot.rom +%ifarch x86_64 %if %{need_qemu_kvm} %{_bindir}/qemu-kvm %{_mandir}/man1/qemu-kvm.1* %endif +%endif %files system-xtensa @@ -2190,13 +2202,13 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %files system-loongarch64 %files system-loongarch64-core %{_bindir}/qemu-system-loongarch64 -%{_datadir}/%{name}/edk2-loongarch64-code.fd -%{_datadir}/%{name}/edk2-loongarch64-vars.fd +%{_datadir}/%{name}/loongarch_bios.bin +%{_datadir}/%{name}/loongarch_vars.bin %{_datadir}/systemtap/tapset/qemu-system-loongarch64*.stp %{_mandir}/man1/qemu-system-loongarch64.1* %if %{need_qemu_kvm} -%{_bindir}/qemu-kvm +%{_libexecdir}/qemu-kvm %{_mandir}/man1/qemu-kvm.1* %endif @@ -2208,7 +2220,10 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog -* Fri Oct 23 2023 xianglai li - 6.2.0-4 +* Mon Jan 15 2024 xianglai li - 6.2.0-5 +- Change the bios name for loongarch. + +* Mon Oct 23 2023 xianglai li - 6.2.0-4 - Fixed a compilation error under loongarch. * Sun Oct 8 2023 xianglai li - 6.2.0-3 -- Gitee