Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 888827 - sys-firmware/ipxe-1.21.1 needs x86_64 uefi binaries built
Summary: sys-firmware/ipxe-1.21.1 needs x86_64 uefi binaries built
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-29 06:06 UTC by razamatan
Modified: 2023-07-31 20:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description razamatan 2022-12-29 06:06:08 UTC
i think this is related to https://bugs.gentoo.org/652842

the current ipxe-1.21.1.ebuild installs only an x86 (not x86_64) version of the ipxe.efi library.  the ebuild needs to be modified to allow the compilation and the installation of the x86_64 ipxe.efi file.

i tried getting a local ebuild to do this, but the compilation dies for me due to some -Wall related warning errors (ignored using make NO_ERRORS=1 ...) and some defined symbol error (undefined symbol: `obj_ipxe32`) during linking.

here's the ebuild patch:

--- /usr/portage/sys-firmware/ipxe/ipxe-1.21.1.ebuild	2022-05-19 05:40:18.000000000 -0700
+++ ipxe-1.21.1.ebuild	2022-12-28 22:04:55.719805489 -0800
@@ -15,7 +15,7 @@
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv x86"
-IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
+IUSE="+binary efi32 efi64 ipv6 iso lkrn +qemu undi usb vmware"
 REQUIRED_USE="!amd64? ( !x86? ( binary ) )"
 
 SOURCE_DEPEND="
@@ -93,7 +93,8 @@
 		ipxemake bin/15ad07b0.rom # vmxnet3
 	fi
 
-	use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
+	use efi32 && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
+	use efi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-efi/ipxe.efi
 	use iso && ipxemake bin/ipxe.iso
 	use undi && ipxemake bin/undionly.kpxe
 	use usb && ipxemake bin/ipxe.usb
@@ -107,7 +108,8 @@
 		doins bin/*.rom
 	fi
 	use vmware && doins bin/*.mrom
-	use efi && doins bin-efi/*.efi
+	use efi32 && doins bin-efi/ipxe.efi
+	use efi64 && doins bin-x86_64-efi/ipxe.efi
 	use iso && doins bin/*.iso
 	use undi && doins bin/*.kpxe
 	use usb && doins bin/*.usb
Comment 1 razamatan 2022-12-29 06:16:23 UTC
also, the binary target tarball also likely needs to be updated as it only contains the x86 binary:

https://dev.gentoo.org/~tamiko/distfiles/ipxe-1.21.1-bin.tar.xz
Comment 2 razamatan 2022-12-30 02:42:16 UTC
it may be good to have a 9999 ebuild to compile against git head.  i just did a local install using head and there were no compilation warnings or errors.

1.21.1 was tagged 2 years ago, and there's been many commits since.
Comment 3 razamatan 2022-12-30 02:48:21 UTC
yeah.. it appears upstream prefers to treat head as stable.  maybe a date ~= git commit hash based versioning approach would work well here.
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-04 19:16:16 UTC
If we were going to package snapshots of IPXE, I think it would make the most sense to package snapshots based on the commit that QEMU pins. In 7.2.0, that would be 4bd064de239dab2426b31c9789a1f4d78087dc63 (https://gitlab.com/qemu-project/qemu/-/tree/b67b00e6b4c7831a3f5bc684bc0df7a9bfd1bd56/roms, https://github.com/ipxe/ipxe/commit/4bd064de23), which is even older than the IPXE version in tree, 1.21.1.
Comment 5 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-04 20:30:23 UTC
With this diff:

diff --git a/sys-firmware/ipxe/ipxe-1.21.1.ebuild b/sys-firmware/ipxe/ipxe-1.21.1.ebuild
index 5136e9ec3d3f..86803e16841e 100644
--- a/sys-firmware/ipxe/ipxe-1.21.1.ebuild
+++ b/sys-firmware/ipxe/ipxe-1.21.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2

 EAPI=7
@@ -15,7 +15,7 @@ S="${WORKDIR}/${P}/src"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv x86"
-IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
+IUSE="+binary efi32 efi64 ipv6 iso lkrn +qemu undi usb vmware"
 REQUIRED_USE="!amd64? ( !x86? ( binary ) )"

 SOURCE_DEPEND="
@@ -93,7 +93,8 @@ src_compile() {
                ipxemake bin/15ad07b0.rom # vmxnet3
        fi

-       use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
+       use efi32 && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
+       use efi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-efi/ipxe.efi
        use iso && ipxemake bin/ipxe.iso
        use undi && ipxemake bin/undionly.kpxe
        use usb && ipxemake bin/ipxe.usb
@@ -107,7 +108,8 @@ src_install() {
                doins bin/*.rom
        fi
        use vmware && doins bin/*.mrom
-       use efi && doins bin-efi/*.efi
+       use efi32 && doins bin-efi/ipxe.efi
+       use efi64 && doins bin-x86_64-efi/ipxe.efiuse efi
        use iso && doins bin/*.iso
        use undi && doins bin/*.kpxe
        use usb && doins bin/*.usb

I get:

# USE="-binary efi32 efi64" emerge -v1 =ipxe-1.21.1
[snip]
>>> Test phase [not enabled]: sys-firmware/ipxe-1.21.1

>>> Install sys-firmware/ipxe-1.21.1 into /var/tmp/portage/sys-firmware/ipxe-1.21.1/image
Traceback (most recent call last):
  File "/usr/lib/portage/python3.10/doins.py", line 609, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/lib/portage/python3.10/doins.py", line 598, in main
    if _doins(
  File "/usr/lib/portage/python3.10/doins.py", line 441, in _doins
    return install_runner.install_file(source, os.path.dirname(dest))
  File "/usr/lib/portage/python3.10/doins.py", line 375, in install_file
    return self._ins_runner.run(source, dest_dir)
  File "/usr/lib/portage/python3.10/doins.py", line 183, in run
    sstat = os.stat(source)
FileNotFoundError: [Errno 2] No such file or directory: b'bin-x86_64-efi/ipxe.efi'
 * ERROR: sys-firmware/ipxe-1.21.1::gentoo failed (install phase):
 *   doins failed
Comment 6 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-04 20:37:57 UTC
Oh, there's a typo in that diff. In any case, this seems to work:

@@ -93,7 +93,8 @@ src_compile() {
                ipxemake bin/15ad07b0.rom # vmxnet3
        fi

-       use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
+       use efi32 && ipxemake PLATFORM=efi BIN=bin-i386-efi bin-i386-efi/ipxe.efi
+       use efi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-x86_64-efi/ipxe.efi
        use iso && ipxemake bin/ipxe.iso
        use undi && ipxemake bin/undionly.kpxe
        use usb && ipxemake bin/ipxe.usb
@@ -107,7 +108,9 @@ src_install() {
                doins bin/*.rom
        fi
        use vmware && doins bin/*.mrom
-       use efi && doins bin-efi/*.efi
+
+       use efi32 && doins bin-i386-efi/ipxe.efi
+       use efi64 && doins bin-x86_64-efi/ipxe.efi
        use iso && doins bin/*.iso
        use undi && doins bin/*.kpxe
        use usb && doins bin/*.usb

But it installs only one ipxe.efi, the latter clobbers the former. I suppose we should do something like Arch does (https://archlinux.org/packages/community/x86_64/ipxe/), and install the .efi's to usr/share/ipxe/{i386,x86_64}/ipxe.efi. Not sure if qemu will automatically see both of those binaries, though.
Comment 7 razamatan 2023-01-04 20:43:46 UTC
yeah.. the patch was my start, and i mentioned in my original post that it doesn't quite work for me.  i was able to compile things following the ipxe directions on a plain checkout at head (i.e. not using the make targets that the ebuild uses).
Comment 8 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-04 22:16:22 UTC
I've added a couple commits to this end here: https://github.com/ajakk/gentoo/tree/bug888827

I plan on polishing for ::gentoo over the next day or two. Feel free to try this, but I've not tested yet at runtime myself.
Comment 9 razamatan 2023-01-05 00:56:07 UTC
cool.

1.  please drop the unused efi use flag in the metadata.xml file change.
2.  will the bin package provide everything (assume full use flags)?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-05 00:57:56 UTC
(In reply to razamatan from comment #9)
> cool.
> 
> 1.  please drop the unused efi use flag in the metadata.xml file change.

I think that'd kind as polishing and it can't be done until old versions are cleaned up. pkgcheck checks for that anyway.
Comment 11 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-05 02:27:29 UTC
(In reply to razamatan from comment #9)
> cool.
> 
> 1.  please drop the unused efi use flag in the metadata.xml file change.

See Sam's comment

> 2.  will the bin package provide everything (assume full use flags)?

Yes, it's a gpkg of sys-firmware/ipxe with USE=*, poking at the internals of the gpkg you can see that USE (the flags the package is actually built with) are a superset of the IUSE flags (the flags declared by the package itself), except for savedconfig:

~/tmp/ipxe-1.21.1-r1-1 $ grep "" metadata/{I,}USE
metadata/IUSE:efi32 efi64 iso usb savedconfig
metadata/USE:abi_x86_64 amd64 efi32 efi64 elibc_glibc iso kernel_linux usb userland_GNU
Comment 12 razamatan 2023-01-17 22:26:49 UTC
any movement here?  i see the branch, but no pr yet.  anything i can help with?
Comment 13 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-18 18:56:43 UTC
(In reply to razamatan from comment #12)
> any movement here?  i see the branch, but no pr yet.  anything i can help
> with?

Sorry, I lost track of this. I'm not really familiar with PXE. Do the changes at that branch work for you?
Comment 14 Larry the Git Cow gentoo-dev 2023-06-18 03:47:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1112a96564118f3449b46e3d02e47e33663b7587

commit 1112a96564118f3449b46e3d02e47e33663b7587
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2023-06-18 03:31:14 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2023-06-18 03:46:07 +0000

    sys-firmware/ipxe: add 1.21.1_p20230601
    
     - update to a git snapshot from early 2023-06-01
    
     - add efi32 and efi64 use flags for compiling/installing 32bit and
       64bit variants of the ipxe.efi binary
    
    Bug: https://bugs.gentoo.org/882393
    Bug: https://bugs.gentoo.org/888827
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 sys-firmware/ipxe/Manifest                     |   2 +
 sys-firmware/ipxe/ipxe-1.21.1_p20230601.ebuild | 127 +++++++++++++++++++++++++
 sys-firmware/ipxe/metadata.xml                 |   3 +-
 3 files changed, 131 insertions(+), 1 deletion(-)
Comment 15 Matthias Maier gentoo-dev 2023-06-18 03:49:23 UTC
I have pushed the suggested changes with one minor difference: I have retained USE=efi for building/installing a 32bit efi binary to maintain backwards compatibility. Enabling USE=efi64 now builds/installs

    /usr/share/ipxe/ipxe-i386.efi
    /usr/share/ipxe/ipxe-x86_64.efi
    /usr/share/ipxe/ipxe.efi -> /usr/share/ipxe/ipxe-x86_64.efi

Please test :-)
Comment 16 razamatan 2023-06-20 08:05:16 UTC
(In reply to Matthias Maier from comment #15)
> I have pushed the suggested changes with one minor difference: I have
> retained USE=efi for building/installing a 32bit efi binary to maintain
> backwards compatibility. Enabling USE=efi64 now builds/installs
> 
>     /usr/share/ipxe/ipxe-i386.efi
>     /usr/share/ipxe/ipxe-x86_64.efi
>     /usr/share/ipxe/ipxe.efi -> /usr/share/ipxe/ipxe-x86_64.efi
> 
> Please test :-)

is there a way to skip/ignore this qemu dep conflict?

WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:

sys-firmware/ipxe:0

  (sys-firmware/ipxe-1.21.1_p20230601:0/0::gentoo, ebuild scheduled for merge) USE="binary efi efi64 lkrn qemu undi usb -ipv6 -iso -savedconfig -vmware" ABI_X86="(64)" conflicts with
    ~sys-firmware/ipxe-1.21.1[binary,qemu] required by (app-emulation/qemu-7.2.0-r3:0/0::gentoo, installed) USE="aio alsa bzip2 curl fdt filecaps gnutls iscsi jpeg ncurses nfs nls opengl oss pam pin-upstream-blobs png pulseaudio python sasl sdl seccomp slirp udev usb vhost-net vnc xattr -accessibility -bpf (-capstone) -debug -doc -fuse -glusterfs -gtk -infiniband -io-uring -jack -jemalloc -lzo -multipath -numa -plugins -rbd -sdl-image (-selinux) -smartcard -snappy -spice -ssh -static -static-user -systemtap -test -usbredir -vde -virgl -virtfs -vte -xen -zstd" ABI_X86="(64)" PYTHON_TARGETS="python3_11 -python3_10" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -avr -cris -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -xtensa -xtensaeb" QEMU_USER_TARGETS="x86_64 -aarch64 -aarch64_be -alpha -arm -armeb -cris -hexagon -hppa -i386 -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -xtensa -xtensaeb"
Comment 17 Argh!... Rats!... 2023-07-31 20:21:37 UTC
(In reply to razamatan from comment #16)
> (In reply to Matthias Maier from comment #15)
> > I have pushed the suggested changes with one minor difference: I have
> > retained USE=efi for building/installing a 32bit efi binary to maintain
> > backwards compatibility. Enabling USE=efi64 now builds/installs
> > 
> >     /usr/share/ipxe/ipxe-i386.efi
> >     /usr/share/ipxe/ipxe-x86_64.efi
> >     /usr/share/ipxe/ipxe.efi -> /usr/share/ipxe/ipxe-x86_64.efi
> > 
> > Please test :-)
> 
> is there a way to skip/ignore this qemu dep conflict?
> 
> WARNING: One or more updates/rebuilds have been skipped due to a dependency
> conflict:
> 
> sys-firmware/ipxe:0
> 
>   (sys-firmware/ipxe-1.21.1_p20230601:0/0::gentoo, ebuild scheduled for
> merge) USE="binary efi efi64 lkrn qemu undi usb -ipv6 -iso -savedconfig
> -vmware" ABI_X86="(64)" conflicts with
>     ~sys-firmware/ipxe-1.21.1[binary,qemu] required by
> (app-emulation/qemu-7.2.0-r3:0/0::gentoo, installed) USE="aio alsa bzip2
> curl fdt filecaps gnutls iscsi jpeg ncurses nfs nls opengl oss pam
> pin-upstream-blobs png pulseaudio python sasl sdl seccomp slirp udev usb
> vhost-net vnc xattr -accessibility -bpf (-capstone) -debug -doc -fuse
> -glusterfs -gtk -infiniband -io-uring -jack -jemalloc -lzo -multipath -numa
> -plugins -rbd -sdl-image (-selinux) -smartcard -snappy -spice -ssh -static
> -static-user -systemtap -test -usbredir -vde -virgl -virtfs -vte -xen -zstd"
> ABI_X86="(64)" PYTHON_TARGETS="python3_11 -python3_10"
> QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -avr -cris -hppa -i386
> -loongarch64 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel
> -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc
> -sparc64 -tricore -xtensa -xtensaeb" QEMU_USER_TARGETS="x86_64 -aarch64
> -aarch64_be -alpha -arm -armeb -cris -hexagon -hppa -i386 -loongarch64 -m68k
> -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32
> -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64le -riscv32 -riscv64 -s390x -sh4
> -sh4eb -sparc -sparc32plus -sparc64 -xtensa -xtensaeb"

You can allways edit file:
- "/etc/portage/package.mask"

and add the line:
- "=sys-firmware/ipxe-1.21.1_p20230601"

That will prevent emerge from complaining by not using the specific version.

Apart from that i have the same Problem that emerge throws the above error when trying to emerge the specified ipxe version