Skip to contentSkip to conversation

ts-xen-build-prep: Grab newer NASM version, to build OVMF

PATCH Superseded Anthony PERARD 3 participants 5 messages May 13, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-xen-build-prep: Grab newer NASM version, to build OVMF

Recent versions of OVMF now need a version of NASM that is newer than the one available on Debian oldstable/buster. They want to use NASM 2.15.05 [1], which is available in Debian stable/bullseye. The need to use a newer version started with d3febfd9ade3 ("MdePkg:
Replace Opcode with the corresponding instructions.").

There is no backport package available but the nasm package from Debian Bullseye can easily be installed on Buster as it has few dependencies and are already satisfied.

[1] https://github.com/tianocore/edk2/commit/6a890db161cd6d378bec3499a1e774db3f5a27a7
("BaseTools: Upgrade the version of NASM tool")

---
 ts-xen-build-prep | 9 +++++++++
 1 file changed, 9 insertions(+)
ts-xen-build-prep +9 -0
index 67b3eae62155..38d4a8e79451 100755
@@ -250,6 +250,15 @@ END
     if ($ho->{Arch} eq 'amd64' && $ho->{Suite} !~ m/squeeze|lenny/) {
         target_install_packages($ho, 'libc6-dev-i386');
     }
+
+    # Use newer version of NASM, for OVMF
+    if ($ho->{Suite} =~ m/buster/) {
+        my $nasm_pkg = "nasm_2.15.05-1_$ho->{Arch}.deb";
+        my $nasm_url = debian_mirror_url_suite_arch("bullseye", $ho->{Arch})
+                       ."/pool/main/n/nasm/$nasm_pkg";
+        target_fetchurl($ho, $nasm_url, "/tmp/$nasm_pkg");
+        target_install_packages($ho, "/tmp/$nasm_pkg");
+    }
 }
 
 sub ccache_setup () {
Signature · 1 line
Anthony PERARD
#1 lore raw
Quoted 6 lines · Anthony PERARD

Recent versions of OVMF now need a version of NASM that is newer than the one available on Debian oldstable/buster. They want to use NASM 2.15.05 [1], which is available in Debian stable/bullseye. The need to use a newer version started with d3febfd9ade3 ("MdePkg:
Replace Opcode with the corresponding instructions.").

Quoted 8 lines

There is no backport package available but the nasm package from Debian Bullseye can easily be installed on Buster as it has few dependencies and are already satisfied.

[1] https://github.com/tianocore/edk2/commit/6a890db161cd6d378bec3499a1e774db3f5a27a7
("BaseTools: Upgrade the version of NASM tool")

A flight with my change:
http://logs.test-lab.xenproject.org/osstest/logs/170388/
(ignore the failing "libvirt-build" jobs which shouldn't be part of the flight ;-) )

Signature · 1 line
Anthony PERARD
#2 lore raw
In reply to Anthony PERARD
Quoted 23 lines · Anthony PERARD

Recent versions of OVMF now need a version of NASM that is newer than the one available on Debian oldstable/buster. They want to use NASM 2.15.05 [1], which is available in Debian stable/bullseye. The need to use a newer version started with d3febfd9ade3 ("MdePkg:
Replace Opcode with the corresponding instructions.").

There is no backport package available but the nasm package from Debian Bullseye can easily be installed on Buster as it has few dependencies and are already satisfied.

[1] https://github.com/tianocore/edk2/commit/6a890db161cd6d378bec3499a1e774db3f5a27a7
("BaseTools: Upgrade the version of NASM tool")

---
 ts-xen-build-prep | 9 +++++++++
 1 file changed, 9 insertions(+)
ts-xen-build-prep +0 -0
index 67b3eae62155..38d4a8e79451 100755

ts-xen-build-prep END · line 259

Quoted 10 lines
ts-xen-build-prep +7 -0
@@ -250,6 +250,15 @@ END
     if ($ho->{Arch} eq 'amd64' && $ho->{Suite} !~ m/squeeze|lenny/) {
         target_install_packages($ho, 'libc6-dev-i386');
     }
+
+    # Use newer version of NASM, for OVMF
+    if ($ho->{Suite} =~ m/buster/) {
+        my $nasm_pkg = "nasm_2.15.05-1_$ho->{Arch}.deb";
+        my $nasm_url = debian_mirror_url_suite_arch("bullseye", $ho->{Arch})
+                       ."/pool/main/n/nasm/$nasm_pkg";
+        target_fetchurl($ho, $nasm_url, "/tmp/$nasm_pkg");

I think this is likely too fragile, what will happen when the package gets bumped to a newer version?

I think we need to store a local copy in osstest and install from there instead of trying to fetch from the upstream Debian mirror.

I guess we could use something similar to DebianExtraPackages?

DebianExtraPackages_build_$arch_$suite nasm_2.15.05-1_$ho->{Arch}.deb

And fetch those using the some_extradebs method.

Thanks, Roger.

#3 lore raw

Roger Pau Monné writes ("Re: [OSSTEST PATCH] ts-xen-build-prep: Grab newer NASM version, to build OVMF"):

Quoted 5 lines

I guess we could use something similar to DebianExtraPackages?

DebianExtraPackages_build_$arch_$suite nasm_2.15.05-1_$ho->{Arch}.deb

And fetch those using the some_extradebs method.

Yes, I think this is better.

Signature · 4 lines
Ian Jackson <[email protected]>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.
#4 lore raw
In reply to Anthony PERARD

Anthony PERARD writes ("[OSSTEST PATCH] ts-xen-build-prep: Grab newer NASM version, to build OVMF"):

Quoted 9 lines

Recent versions of OVMF now need a version of NASM that is newer than the one available on Debian oldstable/buster. They want to use NASM 2.15.05 [1], which is available in Debian stable/bullseye. The need to use a newer version started with d3febfd9ade3 ("MdePkg:
Replace Opcode with the corresponding instructions.").

There is no backport package available but the nasm package from Debian Bullseye can easily be installed on Buster as it has few dependencies and are already satisfied.

I think this is a quite fine bodge.

ts-xen-build-prep END · line 260

Quoted 2 lines
ts-xen-build-prep +2 -0
+        target_fetchurl($ho, $nasm_url, "/tmp/$nasm_pkg");
+        target_install_packages($ho, "/tmp/$nasm_pkg");

I don't think this use of /tmp is very nice. ts-xen-build-prep runs with the host all to itself, so I think you can use /root ?

Ian.

Signature · 4 lines
Ian Jackson <[email protected]>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.