You are not logged in.

#1 2023-09-22 09:26:12

d.ALT
Member
Registered: 2019-05-10
Posts: 920

XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

I'm happily wasting my time big_smile discovering the systemd-boot world, just for fun / curiosity.
So, I'd say that's more a "gossip" post, rather than an "asking-for-support" one.
Let me know if this would still fit into System Administration, anyway.


CHANGES WITH 250:

[...]

*	sd-boot gained support for automatically loading all EFI drivers
	placed in the /EFI/systemd/drivers/ subdirectory of the EFI System
	Partition (ESP). These drivers are loaded before the menu entries are
	loaded. This is useful e.g. to load additional file system drivers
	for the XBOOTLDR partition.

https://github.com/systemd/systemd/blob … 1-L3181C38

# bootctl --esp-path /efi --boot-path /boot --efi-boot-option-description=gomma install

ESP    /dev/nvme0n1p1 [FAT32] on /efi
XBOOTLDR    /dev/nvme0n1p2 [EXT4] on /boot
ROOT    /dev/nvme0n1p2 [EXT4] on /

Installed both efifs and refind.

Tested booting with efifs-x64/ext2_x64.efi:

# cp /usr/lib/efifs-x64/ext2_x64.efi /efi/EFI/systemd/drivers/

and refind/drivers_x64/ext4_x64.efi:

# rm /efi/EFI/systemd/drivers/ext2_x64.efi
# cp /usr/share/refind/drivers_x64/ext4_x64.efi /efi/EFI/systemd/drivers/


Firmware loads systemd-boot just fine, but then systemd-boot itself fails on recognizing XBOOTLDR.
I suspect uEFI HP's firmware implementation is NOT capable of loading third-party *.efi drivers, but...
    shouldn't systemd-boot be in charge of loading $ESP/EFI/systemd/drivers/*.efi on its own, regardless Firmware capabilites?
    What's your thoughts about?

My next try is goin' on booting  UEFI Shell (/efi/shellx64.efi):

load ext4_x64.efi
map -r
systemd-bootx64.efi



I'm booting with GRUB atm, everything's fine.


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#2 2023-09-22 12:12:01

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,635

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

d.ALT wrote:

Firmware loads systemd-boot just fine, but then systemd-boot itself fails on recognizing XBOOTLDR.

What does this mean, exactly? Give errors, not your conclusion.

Offline

#3 2023-09-23 08:59:01

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

Scimmia wrote:
d.ALT wrote:

Firmware loads systemd-boot just fine, but then systemd-boot itself fails on recognizing XBOOTLDR.

Give errors

Systemd-boot-failing.jpg




OK, let's add some more reports here...

d.ALT wrote:

I suspect uEFI HP's firmware implementation is NOT capable of loading third-party *.efi drivers, but...

Mmm... I was wrong, firmware can load ext4-x64.efi driver (/usr/share/refind/drivers_x64/ext4_x64.efi one) from UEFI Shell indeed.
UEFI-Shell-loading-efi-driver.jpg


# efibootmgr | sort -k2

BootOrder: 0002,000A,0003,0001,0000,0004
BootCurrent: 000A
Timeout: 5 seconds
Boot0008  Boot Menu     FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)f9000000000049535048
Boot000A* burger        HD(1,GPT,cd0b7db2-77e9-410e-8124-b9940722fba2,0x800,0x10400)/File(\EFI\burger\grubx64.efi)1400000049535048
Boot0002* edk2  HD(1,GPT,cd0b7db2-77e9-410e-8124-b9940722fba2,0x800,0x10400)/File(\shellx64.efi)
Boot0013  Generic USB Storage   PciRoot(0x0)/Pci(0x14,0x0)/USB(4,0)4eac0881119f594d850ee21a522c59b20980000049535048
Boot0003* gomma HD(1,GPT,cd0b7db2-77e9-410e-8124-b9940722fba2,0x4000,0x82000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0009  HP Recovery   FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)110f0000000049535048
Boot0001* IPV4 Network - Intel(R) Ethernet Connection (5) I219-LM       PciRoot(0x0)/Pci(0x1f,0x6)/MAC(10e7c603ce9f,0)/IPv4(0.0.0.00.0.0.0,0,0)4eac0881119f594d850ee21a522c59b20000000049535048
Boot000D* IPV4 Network - Intel(R) Ethernet Connection (5) I219-LM       PciRoot(0x0)/Pci(0x1f,0x6)/MAC(10e7c603ce9f,0)/IPv4(0.0.0.00.0.0.0,0,0)4eac0881119f594d850ee21a522c59b20000000049535048
Boot0000* IPV6 Network - Intel(R) Ethernet Connection (5) I219-LM       PciRoot(0x0)/Pci(0x1f,0x6)/MAC(10e7c603ce9f,0)/IPv6([::]:<->[::]:,0,0)4eac0881119f594d850ee21a522c59b20000000049535048
Boot000C* IPV6 Network - Intel(R) Ethernet Connection (5) I219-LM       PciRoot(0x0)/Pci(0x1f,0x6)/MAC(10e7c603ce9f,0)/IPv6([::]:<->[::]:,0,0)4eac0881119f594d850ee21a522c59b20000000049535048
Boot000F  Network Boot  FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)120f0000000049535048
Boot0014  PHIYO USBTB3-12 123456789010  PciRoot(0x0)/Pci(0x14,0x0)/USB(16,0)4eac0881119f594d850ee21a522c59b21180000049535048
Boot0015  PHIYO USBTB3-12 123456789010  PciRoot(0x0)/Pci(0x14,0x0)/USB(17,0)4eac0881119f594d850ee21a522c59b21180000049535048
Boot0016  PHIYO USBTB3-12 123456789010  PciRoot(0x0)/Pci(0x14,0x0)/USB(19,0)4eac0881119f594d850ee21a522c59b21180000049535048
Boot0017  PHIYO USBTB3-12 123456789010  PciRoot(0x0)/Pci(0x14,0x0)/USB(20,0)4eac0881119f594d850ee21a522c59b21180000049535048
Boot0005  System Diagnostics    FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)01f20000000049535048
Boot0006  System Diagnostics    FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)02f20000000049535048
Boot0007  System Diagnostics    FvVol(a881d567-6cb0-4eee-8435-2e72d33e45b5)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)03f20000000049535048
Boot0004  USB:          PciRoot(0x0)/Pci(0x14,0x0)4eac0881119f594d850ee21a522c59b20b80000049535048

# bootctl --esp-path /efi/ --boot-path /boot/ list

         type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux (default) (not reported/new)
           id: arch.conf
       source: /boot//loader/entries/arch.conf
        linux: /boot//vmlinuz-linux
       initrd: /boot//intel-ucode.img
               /boot//initramfs-linux.img
      options: root="LABEL=ARCH" rw zswap.enabled=0 mitigations=off

         type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux (fallback initramfs) (not reported/new)
           id: arch-fallback.conf
       source: /boot//loader/entries/arch-fallback.conf
        linux: /boot//vmlinuz-linux
       initrd: /boot//intel-ucode.img
               /boot//initramfs-linux-fallback.img
      options: root="LABEL=ARCH" zswap.enabled=0 mitigations=off

# bootctl --no-pager --esp-path /efi/ --boot-path /boot/ status

System:
      Firmware: n/a (n/a)
 Firmware Arch: x64
   Secure Boot: disabled (setup)
  TPM2 Support: no
  Boot into FW: supported

Current Boot Loader:
      Product: GRUB 2.12~rc1
     Features: ✗ Boot counting
               ✗ Menu timeout control
               ✗ One-shot menu timeout control
               ✗ Default entry control
               ✗ One-shot entry control
               ✗ Support for XBOOTLDR partition
               ✗ Support for passing random seed to OS
               ✗ Load drop-in drivers
               ✗ Support Type #1 sort-key field
               ✗ Support @saved pseudo-entry
               ✗ Support Type #1 devicetree field
               ✗ Enroll SecureBoot keys
               ✗ Retain SHIM protocols
               ✓ Boot loader sets ESP information
          ESP: /dev/disk/by-partuuid/cd0b7db2-77e9-410e-8124-b9940722fba2
         File: └─n/a

Random Seed:
 System Token: set
       Exists: yes

Available Boot Loaders on ESP:
          ESP: /efi (/dev/disk/by-partuuid/cd0b7db2-77e9-410e-8124-b9940722fba2)
         File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot 254.4-1-arch)
               └─/EFI/BOOT/BOOTX64.EFI (systemd-boot 254.4-1-arch)

Boot Loaders Listed in EFI Variables:
        Title: edk2
           ID: 0x0002
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/cd0b7db2-77e9-410e-8124-b9940722fba2
         File: └─/shellx64.efi

        Title: burger
           ID: 0x000A
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/cd0b7db2-77e9-410e-8124-b9940722fba2
         File: └─/EFI/burger/grubx64.efi

        Title: gomma
           ID: 0x0003
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/cd0b7db2-77e9-410e-8124-b9940722fba2
         File: └─/EFI/systemd/systemd-bootx64.efi

Boot Loader Entries:
        $BOOT: /boot (/dev/disk/by-partuuid/316e250b-1c8c-45fb-b11b-308542eef9e7)
        token: arch

Default Boot Loader Entry:
         type: Boot Loader Specification Type #1 (.conf)
        title: Arch Linux
           id: arch.conf
       source: /boot//loader/entries/arch.conf
        linux: /boot//vmlinuz-linux
       initrd: /boot//intel-ucode.img
               /boot//initramfs-linux.img
      options: root="LABEL=ARCH" rw zswap.enabled=0 mitigations=off

# findmnt /boot

TARGET
      SOURCE         FSTYPE OPTIONS
/boot /dev/nvme0n1p2 ext4   rw,relatime

# findmnt /efi

TARGET
     SOURCE         FSTYPE OPTIONS
/efi /dev/nvme0n1p1 vfat   rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro

# tree --noreport --prune --ignore-case -I grub -n /boot /efi

/boot
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── intel-ucode.img
├── loader
│   ├── entries
│   │   ├── arch.conf
│   │   └── arch-fallback.conf
│   └── entries.srel
└── vmlinuz-linux
/efi
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── burger
│   │   └── grubx64.efi
│   └── systemd
│       ├── drivers
│       │   └── ext4-x64.efi	### copied from /usr/share/refind/drivers_x64/ext4_x64.efi ###
│       └── systemd-bootx64.efi
├── loader
│   ├── loader.conf
│   └── random-seed
└── shellx64.efi

# ls -l /dev/disk/by-partuuid/ | sort -k10

totale 0
lrwxrwxrwx 1 root root 15 23 set 09.52 cd0b7db2-77e9-410e-8124-b9940722fba2 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 23 set 09.52 316e250b-1c8c-45fb-b11b-308542eef9e7 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 23 set 09.52 ff13eb49-562b-4f7a-aad1-ed067d9fab37 -> ../../nvme0n1p3

# mount | grep nvme | sort

/dev/nvme0n1p1 on /efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/nvme0n1p2 on /boot type ext4 (rw,relatime)
/dev/nvme0n1p3 on / type ext4 (rw,relatime)

<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#4 2023-09-23 10:26:53

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

Does your XBOOTLDR partition have the correct partition type UUID?

Edit: typos.

Last edited by 3beb6e7c46a615a (2023-09-23 11:30:39)

Offline

#5 2023-09-23 11:04:02

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

lunaryorn wrote:

Does your XBOOTLDR partition have the correct position type UUID?

# sgdisk -i2 /dev/nvme0n1

Partition GUID code: BC13C2FF-59E6-4262-A352-B275FD6F7172 (XBOOTLDR partition)
Partition unique GUID: 316E250B-1C8C-45FB-B11B-308542EEF9E7
First sector: 68608 (at 268.0 MiB)
Last sector: 330751 (at 1.3 GiB)
Partition size: 262144 sectors (1024.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'XBOOTLDR partition'

<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#6 2023-09-23 11:31:06

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,635

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

Post the actual arch.conf file.

Offline

#7 2023-09-23 12:29:19

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: XBOOTLDR on EXT4: systemd-boot fails (?) loading ext4_x64.efi

# ls -la /boot/loader/entries/arch.conf /efi/loader/loader.conf

-rw-r--r-- 1 root root 148 22 set 18.50 /boot/loader/entries/arch.conf
-rwx------ 1 root root  43 16 set 00.54 /efi/loader/loader.conf

# file /boot/loader/entries/arch.conf /efi/loader/loader.conf

/boot/loader/entries/arch.conf: ASCII text
/efi/loader/loader.conf:        ASCII text

# LC_ALL=C cat -t /boot/loader/entries/arch.conf

title Arch Linux
linux vmlinuz-linux
initrd intel-ucode.img
initrd initramfs-linux.img
options root="LABEL=ARCH" rw zswap.enabled=0 mitigations=off

# LC_ALL=C cat -t /efi/loader/loader.conf

default arch.conf
timeout 8
console-mode 2

# sgdisk -i3 /dev/nvme0n1

Partition GUID code: 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 (Linux x86-64 root (/))
Partition unique GUID: FF13EB49-562B-4F7A-AAD1-ED067D9FAB37
First sector: 330752 (at 1.3 GiB)
Last sector: 62514687 (at 238.5 GiB)
Partition size: 62183936 sectors (237.2 GiB)
Attribute flags: 0000000000000000
Partition name: 'Linux x86-64 root (/)'

# ls -l /dev/disk/by-label/ | sort -k10

totale 0
lrwxrwxrwx 1 root root 15 23 set 09.52 ESP -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 23 set 09.52 XBOOTLDR -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 23 set 09.52 ARCH -> ../../nvme0n1p3

<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

Board footer

Powered by FluxBB