FS#64206 - [ovmf] Provide a JSON firmware "descriptor file"

Attached to Project: Arch Linux
Opened by Toolybird (Toolybird) - Monday, 21 October 2019, 19:47 GMT
Last edited by Anatol Pomozov (anatolik) - Saturday, 11 January 2020, 00:30 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 12
Private No

Details

Description:

Recent libvirt needs new JSON desciptor files to properly locate OVMF firmware. This is most apparent when trying to create a new ovmf based VM in virt-manager.

These JSON files were introduced in qemu-4.1[1]

Fedora started shipping their version of these files about 3 months ago[2]

Attached is a patch (tested) against current PKGBUILD. The JSON file is ripped from the qemu-4.1 src with minor edits to match Arch files location.

This will also fix  FS#64175 

1. https://wiki.qemu.org/ChangeLog/4.1#Miscellaneous
2. https://src.fedoraproject.org/rpms/edk2/c/674b3c8a27a85b2d8646a3e9f94f371c5572dd3b?branch=master

This task depends upon

Closed by  Anatol Pomozov (anatolik)
Saturday, 11 January 2020, 00:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  1:r26976.bd85bf54c2-1
Comment by Jeremy Audet (ichimonji10) - Tuesday, 22 October 2019, 17:21 GMT
I can verify that this patch works. Tested with:

```bash
asp checkout ovmf
cd ovmf/trunk/
curl 'https://bugs.archlinux.org/index.php?getfile=17934' | git apply
extra-x86_64-build -- -- --skippgpcheck
sudo pacman -U ovmf-1\:r26214.20d2e5a125-2-any.pkg.tar.xz
sudo systemctl restart libvirtd
```

Passing `--skipgpgcheck` to `makepkg` is necessary because openssl-1.1.1b is signed with a key that's not in my keyring, and I'm unable to find info about it through keyserver.pgp.com or pgp.mit.edu.
Comment by Legit Salvage (Breach_Candy) - Sunday, 01 December 2019, 19:35 GMT
Sorry if this is a dumb question(It probably is), but how do I apply this patch?
TIA
Comment by Jeremy Audet (ichimonji10) - Sunday, 01 December 2019, 19:40 GMT
My comment above shows how I applied the patch.
Comment by Legit Salvage (Breach_Candy) - Sunday, 01 December 2019, 20:01 GMT
I ran this as a script:
asp checkout ovmf
cd ovmf/trunk/
curl 'https://bugs.archlinux.org/index.php?getfile=17934' | git apply
extra-x86_64-build -- -- --skippgpcheck
sudo pacman -U ovmf-1\:r26214.20d2e5a125-2-any.pkg.tar.xz
sudo systemctl restart libvirtd

and this was the output: https://imgur.com/a/p31gdnP
What am I doing wrong? TIA
Comment by Martin Rys (C0rn3j) - Sunday, 01 December 2019, 20:12 GMT
"asp not found"

One would assume you are missing asp.
Comment by Jeremy Audet (ichimonji10) - Sunday, 01 December 2019, 20:16 GMT
Also:

* Be wary of running that entire script as root. That's a great way to screw up your system.
* Consider reading about the tools at hand. A fine place to start is by reading about the arch build system. https://wiki.archlinux.org/index.php/Arch_Build_System
Comment by Legit Salvage (Breach_Candy) - Sunday, 01 December 2019, 20:21 GMT
Thanks, the ASP part worked, but now i'm getting
./OVMF: line 7: extra-x86_64-build: command not found
loading packages...
error: 'ovmf-1:r26214.20d2e5a125-2-any.pkg.tar.xz': could not find or read package
Sorry, Im a bit new to this.
Comment by Martin Rys (C0rn3j) - Sunday, 01 December 2019, 20:41 GMT
"extra-x86_64-build not found"

One would assume you are missing the package containing extra-x86_64-build.
Comment by Legit Salvage (Breach_Candy) - Sunday, 01 December 2019, 20:48 GMT
It was devtools. Thanks.
Comment by Legit Salvage (Breach_Candy) - Sunday, 01 December 2019, 21:04 GMT
When attempting to install the VM, I get this message: https://pastebin.com/dCqa1pPU Sorry if this is the wrong place.

Edit - I forgot to paste nvram entry into /etc/libivrt/qemu.conf
Sorry
Comment by Ronny Lövstrand (ronnylov) - Saturday, 14 December 2019, 12:51 GMT
I got the same error as Legit Salvage described above after installing this patch.
Saw the comment https://bugs.archlinux.org/task/64175#comment183769 by Dario on this bug: https://bugs.archlinux.org/task/64175

I added in the os section of XML file of my virtual machine named win10:
<nvram template="/usr/share/ovmf/x64/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>

After this it was possible to boot.
Comment by Anatol Pomozov (anatolik) - Wednesday, 08 January 2020, 03:48 GMT
Thank you for debugging. I see that upstream (qemu) provides 2 files secureboot and non-secure versions https://git.qemu.org/?p=qemu.git;a=tree;f=pc-bios/descriptors

Do we need to add both files to OVMF?
Comment by Anatol Pomozov (anatolik) - Wednesday, 08 January 2020, 21:04 GMT
Please check ovmf in [testing] and let me know if it works for you.

Loading...