mbox series

[bug#72457,v3,00/15] Rewrite bootloader subsystem.

Message ID cover.1722803521.git.lilah@lunabee.space
Headers show
Series Rewrite bootloader subsystem. | expand

Message

Lilah Tascheter Aug. 4, 2024, 8:31 p.m. UTC
Goddamnit, alright, how's this?

And thanks for the patch :) though, the file-system bit there is supposed to be
mount-type. The file-system field holds the filesystem type; path holds
mountpoint.

Lilah Tascheter (15):
  guix: scripts: Rewrite reinstall-bootloader to use provenance data.
  gnu: Add bootloader target infastructure.
  guix: scripts: Remove unused code.
  gnu: Core bootloader changes.
  gnu: system: Remove useless boot parameters.
  gnu: bootloader: Add raspberry pi bootloader.
  gnu: system: Fix bootloader crypto device recognition.
  gnu: packages: Add pesign.
  gnu: packages: Add ukify.
  gnu: packages: Add systemd-stub.
  gnu: bootloaders: Add uki-efi-bootloader.
  gnu: system: Update examples.
  doc: Update bootloader documentation.
  gnu: tests: Update tests to new targets system.
  teams: Add bootloading team.

 doc/guix.texi                                 |  458 +++---
 etc/teams.scm                                 |   10 +
 gnu/bootloader.scm                            |  662 ++++++---
 gnu/bootloader/depthcharge.scm                |  153 +-
 gnu/bootloader/extlinux.scm                   |  149 +-
 gnu/bootloader/grub.scm                       | 1279 +++++++----------
 gnu/bootloader/u-boot.scm                     |  505 +++----
 gnu/bootloader/uki.scm                        |   96 ++
 gnu/build/bootloader.scm                      |  157 +-
 gnu/build/image.scm                           |   40 +-
 gnu/build/install.scm                         |   16 +-
 gnu/image.scm                                 |    3 +
 gnu/installer/parted.scm                      |   12 +-
 gnu/local.mk                                  |    1 +
 gnu/machine/ssh.scm                           |   71 +-
 gnu/packages/bootloaders.scm                  |  277 ++--
 gnu/packages/efi.scm                          |   47 +
 gnu/packages/raspberry-pi.scm                 |   18 -
 gnu/services/virtualization.scm               |   11 +-
 gnu/system.scm                                |   62 +-
 gnu/system/boot.scm                           |   16 +-
 gnu/system/examples/asus-c201.tmpl            |    6 +-
 gnu/system/examples/bare-bones.tmpl           |    7 +-
 gnu/system/examples/bare-hurd.tmpl            |    4 +-
 gnu/system/examples/beaglebone-black.tmpl     |    6 +-
 gnu/system/examples/desktop.tmpl              |    4 +-
 gnu/system/examples/docker-image.tmpl         |    6 +-
 gnu/system/examples/lightweight-desktop.tmpl  |    4 +-
 gnu/system/examples/plasma.tmpl               |    4 +-
 .../examples/raspberry-pi-64-nfs-root.tmpl    |   23 +-
 gnu/system/examples/raspberry-pi-64.tmpl      |   18 +-
 gnu/system/examples/vm-image.tmpl             |    5 +-
 gnu/system/hurd.scm                           |    4 +-
 gnu/system/image.scm                          |  162 ++-
 gnu/system/images/hurd.scm                    |    4 +-
 gnu/system/images/novena.scm                  |    3 +-
 .../images/orangepi-r1-plus-lts-rk3328.scm    |    3 +-
 gnu/system/images/pine64.scm                  |    3 +-
 gnu/system/images/pinebook-pro.scm            |    3 +-
 gnu/system/images/rock64.scm                  |    3 +-
 gnu/system/images/unmatched.scm               |    3 +-
 gnu/system/images/visionfive2.scm             |    3 +-
 gnu/system/images/wsl2.scm                    |   14 +-
 gnu/system/install.scm                        |   43 +-
 gnu/system/vm.scm                             |   11 -
 gnu/tests.scm                                 |    4 +-
 gnu/tests/ganeti.scm                          |    4 +-
 gnu/tests/image.scm                           |    4 +-
 gnu/tests/install.scm                         |   80 +-
 gnu/tests/nfs.scm                             |    4 +-
 gnu/tests/reconfigure.scm                     |   86 +-
 gnu/tests/telephony.scm                       |    4 +-
 gnu/tests/vnc.scm                             |    4 +-
 guix/scripts/system.scm                       |  162 +--
 guix/scripts/system/reconfigure.scm           |  159 +-
 guix/ui.scm                                   |    8 +
 tests/boot-parameters.scm                     |   16 +-
 57 files changed, 2389 insertions(+), 2535 deletions(-)
 create mode 100644 gnu/bootloader/uki.scm


base-commit: 7d781027c78bdea5fdb3f1c9c9ec432b9606d2b5

Comments

Sergey Trofimov Aug. 5, 2024, 7 a.m. UTC | #1
Hi Lilah,

On Sun, 4 Aug 2024 at 22:33, Lilah Tascheter <lilah@lunabee.space> wrote:
>
> Goddamnit, alright, how's this?

Unfortunately it still doesn't work. Here is my debug session:

Error:
--8<---------------cut here---------------start------------->8---
In srfi/srfi-1.scm:
   586:17  8 (map1 (#f #<<uuid> type: fat bv: #vu8(77 160 163 107)>
#<<uuid> type: dce bv: #vu8(246 188 138 216 255 26 23 84 83 48 172 24
246 188 138 216)> #<<uuid> type: fat bv: #vu8(77 160 163 107)>))
In ice-9/eval.scm:
   293:34  7 (_ #(#(#(#(#(#(#<directory (gnu bootloader)
7f49dbce61e0>) #f (#f #<<uuid> type: fat bv: #vu8(77 160 163 107)>
#<<uuid> type: dce bv: #vu8(246 188 138 216 255 26 23 84 83 48 172 24
246 188 138 216)> #<<uuid> type: fat bv: #vu8(77 160 163 107)>))
#<procedure up (a)>) (#f)) (#f #f)) #<procedure offset (a)>))
   191:35  6 (_ #(#(#(#(#(#(#<directory (gnu bootloader)
7f49dbce61e0>) #f (#f #<<uuid> type: fat bv: #vu8(77 160 163 107)>
#<<uuid> type: dce bv: #vu8(246 188 138 216 255 26 23 84 83 48 172 24
246 188 138 216)> #<<uuid> type: fat bv: #vu8(77 160 163 107)>))
#<procedure up (a)>) (#f)) (#f #f)) #<procedure offset (a)>))
    163:9  5 (_ #(#(#(#(#(#(#<directory (gnu bootloader)
7f49dbce61e0>) #f (#f #<<uuid> type: fat bv: #vu8(77 160 163 107)>
#<<uuid> type: dce bv: #vu8(246 188 138 216 255 26 23 84 83 48 172 24
246 188 138 216)> #<<uuid> type: fat bv: #vu8(77 160 163 107)>))
#<procedure up (a)>) (#f)) (#f #f)) #<procedure offset (a)>))
In srfi/srfi-1.scm:
   586:17  4 (map1 (#f))
In ice-9/eval.scm:
    263:9  3 (_ #(#(#<directory (gnu bootloader) 7f49dbce61e0>) #f))
    155:9  2 (_ _)
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:
In procedure struct-vtable: Wrong type argument in position 1
(expecting struct): #f
--8<---------------cut here---------------end--------------->8---


Trying to debug it in REPL:
--8<---------------cut here---------------start------------->8---
,m (gnu bootloader)
,use (gnu bootloader grub)

(bootloader-configuration->gexp
  (bootloader-configuration
    (bootloader grub-efi-bootloader)
    (targets (list (bootloader-target (type 'esp) (path "/boot"))))) '())
--8<---------------cut here---------------end--------------->8---

List of targets passed to normalize:
--8<---------------cut here---------------start------------->8---
#<<bootloader-target> type: vendir expected?: #f path: "EFI/Guix"
offset: #<procedure offset (a)> device: #f file-system: #f label: #f
uuid: #f>
#<<bootloader-target> type: install expected?: #f path: "boot" offset:
#<procedure offset (a)> device: #f file-system: #f label: #f uuid: #f>
#<<bootloader-target> type: root expected?: #f path: "/" offset:
#<procedure offset (x)> device: #f file-system: #f label: #f uuid: #f>
#<<bootloader-target> type: esp expected?: #f path: "/boot" offset:
#<procedure feb5818 at <unknown port>:132:19 (x)> device: #f
file-system: #f label: #f uuid: #f>)
--8<---------------cut here---------------end--------------->8---

(mounts):
--8<---------------cut here---------------start------------->8---
#<<mount> devno: 21 source: "none" point: "/proc" type: "proc"
options: "rw,relatime">
#<<mount> devno: 6 source: "none" point: "/dev" type: "devtmpfs"
options: "rw,relatime">
#<<mount> devno: 22 source: "none" point: "/sys" type: "sysfs"
options: "rw,relatime">
#<<mount> devno: 2050 source: "/dev/sda2" point: "/" type: "ext4"
options: "rw,relatime">
#<<mount> devno: 2049 source: "/dev/sda1" point: "/boot" type: "vfat"
options: "rw,relatime">
#<<mount> devno: 24 source: "none" point: "/dev/pts" type: "devpts"
options: "rw,relatime">
#<<mount> devno: 8 source: "none" point: "/sys/kernel/debug" type:
"debugfs" options: "rw,relatime">
#<<mount> devno: 25 source: "tmpfs" point: "/dev/shm" type: "tmpfs"
options: "rw,nosuid,nodev,relatime">
#<<mount> devno: 26 source: "efivarfs" point:
"/sys/firmware/efi/efivars" type: "efivarfs" options: "rw,relatime">
#<<mount> devno: 2050 source: "/dev/sda2" point: "/gnu/store" type:
"ext4" options: "ro,noatime">
#<<mount> devno: 27 source: "none" point: "/run/systemd" type: "tmpfs"
options: "rw,nosuid,nodev,noexec,relatime">
#<<mount> devno: 28 source: "none" point: "/run/user" type: "tmpfs"
options: "rw,nosuid,nodev,noexec,relatime">
#<<mount> devno: 29 source: "none" point: "/sys/fs/cgroup" type:
"cgroup2" options: "rw,relatime">
#<<mount> devno: 30 source: "cgroup" point: "/sys/fs/cgroup/elogind"
type: "cgroup" options: "rw,relatime">
#<<mount> devno: 31 source: "tmpfs" point: "/run/user/1000" type:
"tmpfs" options: "rw,nosuid,nodev,relatime">
#<<mount> devno: 33 source: "portal" point: "/run/user/1000/doc" type:
"fuse.portal" options: "rw,nosuid,nodev,relatime">
--8<---------------cut here---------------end--------------->8---

(disk-partitions): ("sda" "sda1" "sda2")

labels: sda1: GNU-ESP sda2: Guix_image

uuids:
--8<---------------cut here---------------start------------->8---
(read-partition-uuid "/dev/sda2")
#vu8(246 188 138 216 255 26 23 84 83 48 172 24 246 188 138 216)

(read-partition-uuid "/dev/sda1")
#vu8(77 160 163 107)
--8<---------------cut here---------------end--------------->8---

It seems that device couldn't be guessed for the vendir target, as
(unfold-pathcat) returns a path (/boot/EFI/Guix) that is not in
(mounts).