Subject: bug#55343: closed (Re: bug#55343: Add support for 32bit UEFI)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 24 Jun 2022 08:25:01 +0000

Your bug report

#55343: Add support for 32bit UEFI

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55343: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55343
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55343: Add support for 32bit UEFI
From: Mathieu Othacehe <[email-masked]>
To: Timothy Sample <[email-masked]>
Cc: Ludovic Courtès <[email-masked]>, Maxime Devos <[email-masked]>, Denis 'GNUtoo' Carikli <[email-masked]>, [email-masked]
Date: Fri, 24 Jun 2022 10:23:54 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hey,

>   This way we could get rid of the grub-efi32 package and rely only on
>   the grub-efi package. We would need to come up with something
>   similar for the aarch64-linux Grub package I guess.

I tried to do that, turns out Grub doesn't have support for building
modules for multiple architectures in a single pass. You need to call
configure and make for each architecture. Having a dedicated grub-efi32
doesn't seem so bad after all.

I pushed the patchset, thanks!

Mathieu

Subject: Add support for 32bit UEFI
From: Denis 'GNUtoo' Carikli <[email-masked]>
To: [email-masked]
Date: Tue, 10 May 2022 01:18:12 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I was lent a tablet with an x86_64 CPU and a 32bit UEFI. As I wanted
to test Guix on it, I ended up making patches to add support for 32bit
UEFI. This also enabled me to learn more about UEFI in the process.

In these patches (that will be sent right after this mail), I added a
grub-efi32 package that makes sure it is compiled for 32bit, even on
64bit systems, and to use it, I added and a new 'efi32-raw' image type.

I've copied (with dd) a system image that I made with this command on a
x86_64 Guix:
> guix system image -t efi32-raw system.scm
to an USB key that I then booted on a Dell Venue Pro 8.

I've attached the system.scm used for the tests (it's based on the
desktop.tmpl in the Guix source code).

I validated that the device booted fine up to gdm.

I also validated that the grub image generated with this package was
32bit with the following commands (on both i686 and x86_64 computers):
> /gnu/store/[...]-grub-efi32-2.06/bin/grub-mkimage \
> -O i386-efi -p / -o /tmp/grub.img
> $ file /tmp/grub.img 
> /tmp/grub.img: PE32 executable (EFI application) Intel 80386 (stripped
> to external PDB), for MS Windows

I've not yet tried to create an image with grub-efi32 on i686 but I
assume that it's not necessarily an issue since grub system image also
has targets like novena-raw that don't work for x86.

I also don't have ARM UEFI machines so I still added support for that
but I could not test it.

Also, for some reasons guix lint fails on i686 while it works fine for
x86_64:
> $ ./pre-inst-env guix lint grub-efi32
> gnu/packages/bootloaders.scm:337:2: [email-masked]: label
> 'ld-wrapper' does not match package name 'ld-wrapper-i386'
> gnu/packages/bootloaders.scm:337:2: [email-masked]: label 'binutils'
> does not match package name 'binutils-i386'
> gnu/packages/bootloaders.scm:337:2: [email-masked]: label 'qemu'
> does not match package name 'qemu-minimal'
> gnu/packages/bootloaders.scm:337:2: [email-masked]: label 'gettext'
> does not match package name 'gettext-minimal'
> gnu/packages/bootloaders.scm:337:2: [email-masked]: file names of
> patches should start with the package name Backtrace:[email-masked]
> [gnu-description]... In ice-9/boot-9.scm: 1752:10 17
> (with-exception-handler _ _ #:unwind? _ # _) In unknown file: 16
> (apply-smob/0 #<thunk 919b010>) In ice-9/boot-9.scm: 724:2 15
> (call-with-prompt _ _ #<procedure default-prompt-handle…>) In
> ice-9/eval.scm: 619:8 14 (_ #(#(#<directory (guile-user) 9192690>)))
> In guix/ui.scm: 2230:7 13 (run-guix . _)
>   2193:10 12 (run-guix-command _ . _)
> In ice-9/boot-9.scm:
>   1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
>   1752:10 10 (with-exception-handler _ _ #:unwind? _ # _)
> In guix/store.scm:
>    658:37  9 (thunk)
> In srfi/srfi-1.scm:
>     634:9  8 (for-each #<procedure 9265740 at guix/scripts/lint.scm…>
> …) In guix/scripts/lint.scm:
>      65:4  7 (run-checkers _ _ #:store _)
> In srfi/srfi-1.scm:
>     634:9  6 (for-each #<procedure b0bd948 at guix/scripts/lint.scm…>
> …) In guix/scripts/lint.scm:
>     74:21  5 (_ _)
> In guix/lint.scm:
>    1093:2  4 (check-gnu-synopsis+description #<package
> grub-efi32@2.…>) In srfi/srfi-1.scm:
>    730:15  3 (find #<procedure b8d71d0 at guix/lint.scm:1093:15 (de…>
> …) In guix/gnu-maintenance.scm:
>    100:21  2 (_ #<<gnu-package-descriptor> name: "3dldf"
> mundane-nam…>) In ice-9/boot-9.scm:
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> error: <gnu-package-descriptor>: unbound variable

Denis.