all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#55343] Add support for 32bit UEFI
@ 2022-05-09 23:18 Denis 'GNUtoo' Carikli
  2022-05-09 23:24 ` [bug#55343] [PATCH 1/2] utils: Define 'target-x86?' predicate Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 17+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2022-05-09 23:18 UTC (permalink / raw)
  To: 55343


[-- Attachment #1.1: Type: text/plain, Size: 3703 bytes --]

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: grub-efi32@2.06: label
> 'ld-wrapper' does not match package name 'ld-wrapper-i386'
> gnu/packages/bootloaders.scm:337:2: grub-efi32@2.06: label 'binutils'
> does not match package name 'binutils-i386'
> gnu/packages/bootloaders.scm:337:2: grub-efi32@2.06: label 'qemu'
> does not match package name 'qemu-minimal'
> gnu/packages/bootloaders.scm:337:2: grub-efi32@2.06: label 'gettext'
> does not match package name 'gettext-minimal'
> gnu/packages/bootloaders.scm:337:2: grub-efi32@2.06: file names of
> patches should start with the package name Backtrace:rub-efi32@2.06
> [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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: system.scm --]
[-- Type: text/x-scheme, Size: 3406 bytes --]

(use-modules (gnu) (gnu system nss) (guix utils))
(use-service-modules desktop sddm xorg)
(use-package-modules certs gnome)

(operating-system
  (host-name "dell-venue-8-pro")
  (timezone "Europe/Paris")
  (locale "en_US.utf8")

  (keyboard-layout (keyboard-layout "us" "altgr-intl"))

  ;; This device has a 32bit UEFI
  (bootloader (bootloader-configuration
	       (bootloader grub-efi32-bootloader)
               (targets '("/boot/efi"))
               (keyboard-layout keyboard-layout)))

  ;; Specify a mapped device for the encrypted root partition.
  ;; The UUID is that returned by 'cryptsetup luksUUID'.
  (mapped-devices
   (list (mapped-device
          (source (uuid "12345678-1234-1234-1234-123456789abc"))
          (target "my-root")
          (type luks-device-mapping))))

  (file-systems (append
                 (list (file-system
                         (device (file-system-label "my-root"))
                         (mount-point "/")
                         (type "ext4")
                         (dependencies mapped-devices))
                       (file-system
                         (device (uuid "1234-ABCD" 'fat))
                         (mount-point "/boot/efi")
                         (type "vfat")))
                 %base-file-systems))

  ;; Specify a swap file for the system, which resides on the
  ;; root file system.
  (swap-devices (list (swap-space
                       (target "/swapfile"))))

  (users (cons (user-account
                (name "parinux")
                (comment "Parinux")
		(group "parinux"))
               %base-user-accounts))

  (groups (cons* (user-group
                  (name "parinux"))
                 %base-groups))



  ;; This is where we specify system-wide packages.
  (packages (append (list
                     ;; for HTTPS access
                     nss-certs
                     ;; for user mounts
                     gvfs)
                    %base-packages))

  ;; Add GNOME and Xfce---we can choose at the log-in screen
  ;; by clicking the gear.  Use the "desktop" services, which
  ;; include the X11 log-in service, networking with
  ;; NetworkManager, and more.
  (services (if (target-x86-64?)
                (append (list (service gnome-desktop-service-type)
                              (service xfce-desktop-service-type)
                              (set-xorg-configuration
                               (xorg-configuration
                                (keyboard-layout keyboard-layout))))
                        %desktop-services)

                ;; FIXME: Since GDM depends on Rust (gdm -> gnome-shell -> gjs
                ;; -> mozjs -> rust) and Rust is currently unavailable on
                ;; non-x86_64 platforms, we use SDDM and Mate here instead of
                ;; GNOME and GDM.
                (append (list (service mate-desktop-service-type)
                              (service xfce-desktop-service-type)
                              (set-xorg-configuration
                               (xorg-configuration
                                (keyboard-layout keyboard-layout))
                               sddm-service-type))
                        %desktop-services)))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-06-24  8:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-09 23:18 [bug#55343] Add support for 32bit UEFI Denis 'GNUtoo' Carikli
2022-05-09 23:24 ` [bug#55343] [PATCH 1/2] utils: Define 'target-x86?' predicate Denis 'GNUtoo' Carikli
2022-05-09 23:24   ` [bug#55343] [PATCH 2/2] image: Add new efi32-raw format for 32bit UEFI on 64bit systems Denis 'GNUtoo' Carikli
2022-05-10  9:32     ` Maxime Devos
2022-05-10 21:39       ` Denis 'GNUtoo' Carikli
2022-05-11  9:07         ` Maxime Devos
2022-05-11 17:35           ` Denis 'GNUtoo' Carikli
2022-05-11 17:00       ` Denis 'GNUtoo' Carikli
2022-05-11 17:19         ` Maxime Devos
2022-05-11 17:25         ` Maxime Devos
2022-05-18 13:50           ` Denis 'GNUtoo' Carikli
2022-06-11 16:41             ` Denis 'GNUtoo' Carikli
2022-06-17 20:36               ` [bug#55343] Add support for 32bit UEFI Ludovic Courtès
2022-06-18  5:18                 ` Timothy Sample
2022-06-19 19:02                   ` Mathieu Othacehe
2022-06-24  8:23                     ` bug#55343: " Mathieu Othacehe
2022-06-11 19:52             ` [bug#55343] [PATCH 2/2] image: Add new efi32-raw format for 32bit UEFI on 64bit systems Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.