Skip to content

eos-esp-generator fails in ISO image #183

@ssssam

Description

@ssssam

I don't know what ramifications this has, but there is a crash in eos-esp-generator in the current live image.

Here's notes from me debugging it:

# ./eos-esp-generator  --debug /var/tmp/normal /var/tmp/early /var/tmp/late
eos-esp-generator:DEBUG:> findmnt --real --json --list --canonicalize --evaluate --nofsroot --output TARGET,SOURCE,MAJ:MIN,FSTYPE,FSROOT,OPTIONS
eos-esp-generator:DEBUG:mounts:
eos-esp-generator:DEBUG: {'target': '/sysroot', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG: {'target': '/', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/ostree/deploy/eos/deploy/2b8683395f75824e9a0eb646b045e60e392a7cd10076d86b469d30c8db9531b6.0', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG: {'target': '/boot', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/boot', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG: {'target': '/usr', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/ostree/deploy/eos/deploy/2b8683395f75824e9a0eb646b045e60e392a7cd10076d86b469d30c8db9531b6.0/usr', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG: {'target': '/var', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/ostree/deploy/eos/var', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG: {'target': '/run/user/979/doc', 'source': 'portal', 'maj:min': '0:80', 'fstype': 'fuse.portal', 'fsroot': '/', 'options': 'rw,nosuid,nodev,relatime,user_id=979,group_id=979'}
eos-esp-generator:DEBUG: {'target': '/mnt', 'source': '/dev/loop1p3', 'maj:min': '259:2', 'fstype': 'ext4', 'fsroot': '/', 'options': 'ro,relatime'}
eos-esp-generator:DEBUG:> findmnt --fstab --json --list --canonicalize --evaluate --nofsroot --output TARGET,SOURCE,MAJ:MIN,FSTYPE,FSROOT,OPTIONS
eos-esp-generator:DEBUG:fstab:
eos-esp-generator:DEBUG: {'target': '/', 'source': '/dev/gpt-auto-root', 'maj:min': None, 'fstype': 'ext4', 'fsroot': None, 'options': 'errors=remount-ro,relatime'}
eos-esp-generator:DEBUG:> blkid -d -c /dev/null -o device
eos-esp-generator:DEBUG:partition devices: ['/dev/loop1p2', '/dev/loop1p3', '/dev/loop1p1', '/dev/sr0', '/dev/loop0', '/dev/zram0']
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/loop1p2
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/loop1p3
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/loop1p1
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/sr0
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/loop0
eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/zram0
eos-esp-generator:DEBUG:partitions:
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/loop1p2', 'PART_ENTRY_SCHEME': 'gpt', 'PART_ENTRY_UUID': '8a594e39-1335-424e-9f5c-88e765a01401', 'PART_ENTRY_TYPE': '21686148-6449-6e6f-744e-656564454649', 'PART_ENTRY_NUMBER': '2', 'PART_ENTRY_OFFSET': '129024', 'PART_ENTRY_SIZE': '2048', 'PART_ENTRY_DISK': '7:1'}
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/loop1p3', 'LABEL': 'ostree', 'UUID': 'd7b23620-e93b-4a3e-b3e4-39905f1639ce', 'VERSION': '1.0', 'FSBLOCKSIZE': '4096', 'BLOCK_SIZE': '4096', 'FSLASTBLOCK': '1700864', 'FSSIZE': '6966738944', 'TYPE': 'ext4', 'USAGE': 'filesystem', 'PART_ENTRY_SCHEME': 'gpt', 'PART_ENTRY_UUID': 'e416af41-0b48-4af1-9868-f05877655e65', 'PART_ENTRY_TYPE': '4f68bce3-e8cd-4db1-96e7-fbcaf984b709', 'PART_ENTRY_FLAGS': '0x80000000000000', 'PART_ENTRY_NUMBER': '3', 'PART_ENTRY_OFFSET': '131072', 'PART_ENTRY_SIZE': '13606912', 'PART_ENTRY_DISK': '7:1'}
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/loop1p1', 'SEC_TYPE': 'msdos', 'LABEL_FATBOOT': 'EFI', 'LABEL': 'EFI', 'UUID': '0B4F-0476', 'VERSION': 'FAT16', 'FSBLOCKSIZE': '2048', 'BLOCK_SIZE': '512', 'FSSIZE': '64995840', 'TYPE': 'vfat', 'USAGE': 'filesystem', 'PART_ENTRY_SCHEME': 'gpt', 'PART_ENTRY_UUID': '6c2473e9-e731-4831-a10a-59f28d412da4', 'PART_ENTRY_TYPE': 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b', 'PART_ENTRY_NUMBER': '1', 'PART_ENTRY_OFFSET': '2048', 'PART_ENTRY_SIZE': '126976', 'PART_ENTRY_DISK': '7:1'}
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/sr0', 'FSBLOCKSIZE': '2048', 'BLOCK_SIZE': '2048', 'FSSIZE': '2546530304', 'PUBLISHER_ID': 'Endless OS Foundation LLC', 'DATA_PREPARER_ID': 'XORRISO-1.5.4 2021.01.30.150001, LIBISOBURN-1.5.4, LIBISOFS-1.5.4, LIBBURN-1.5.4', 'UUID': '2025-10-22-13-53-43-00', 'BOOT_SYSTEM_ID': 'EL TORITO SPECIFICATION', 'VERSION': 'Joliet Extension', 'LABEL': 'Endless-OS-Nightly-base', 'TYPE': 'iso9660', 'USAGE': 'filesystem', 'PTTYPE': 'dos'}
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/loop0', 'VERSION': '4.0', 'FSBLOCKSIZE': '131072', 'BLOCK_SIZE': '131072', 'FSSIZE': '2535460176', 'TYPE': 'squashfs', 'USAGE': 'filesystem'}
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/zram0', 'ENDIANNESS': 'LITTLE', 'FSBLOCKSIZE': '4096', 'FSSIZE': '1032843264', 'FSLASTBLOCK': '252160', 'LABEL': 'zram0', 'UUID': '23924104-5782-4a57-b511-302b75d45898', 'VERSION': '1', 'TYPE': 'swap', 'USAGE': 'other'}
eos-esp-generator:DEBUG:Determined root partition {'DEVNAME': '/dev/loop1p3', 'LABEL': 'ostree', 'UUID': 'd7b23620-e93b-4a3e-b3e4-39905f1639ce', 'VERSION': '1.0', 'FSBLOCKSIZE': '4096', 'BLOCK_SIZE': '4096', 'FSLASTBLOCK': '1700864', 'FSSIZE': '6966738944', 'TYPE': 'ext4', 'USAGE': 'filesystem', 'PART_ENTRY_SCHEME': 'gpt', 'PART_ENTRY_UUID': 'e416af41-0b48-4af1-9868-f05877655e65', 'PART_ENTRY_TYPE': '4f68bce3-e8cd-4db1-96e7-fbcaf984b709', 'PART_ENTRY_FLAGS': '0x80000000000000', 'PART_ENTRY_NUMBER': '3', 'PART_ENTRY_OFFSET': '131072', 'PART_ENTRY_SIZE': '13606912', 'PART_ENTRY_DISK': '7:1'}
eos-esp-generator:DEBUG:Found endless.image.device kernel command line arg is UUID=2025-10-22-13-53-43-00
eos-esp-generator:DEBUG:Reading EFI variable /sys/firmware/efi/efivars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
eos-esp-generator:DEBUG:EFI variable LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f not set

At this point, execution is in _get_esp_part().

The EFI variable LoaderDevicePartUUID is not set -- probably as we use GRUB to boot, instead of systemd-boot which would set the variable (see systemd-boot(7).

The endless.image.device kernel argument is set (to UUID=2025-10-22-13-53-43-00 in this case), as expected in the ISO image.

The code therefore uses the partition info fetched from blkid --probe for that device, /dev/sr0 in this case, which is as follows:

eos-esp-generator:DEBUG:> blkid --probe -d -c /dev/null -o export /dev/sr0
eos-esp-generator:DEBUG: {'DEVNAME': '/dev/sr0', 'FSBLOCKSIZE': '2048', 'BLOCK_SIZE': '2048', 'FSSIZE': '2546530304', 'PUBLISHER_ID': 'Endless OS Foundation LLC', 'DATA_PREPARER_ID': 'XORRISO-1.5.4 2021.01.30.150001, LIBISOBURN-1.5.4, LIBISOFS-1.5.4, LIBBURN-1.5.4', 'UUID': '2025-10-22-13-53-43-00', 'BOOT_SYSTEM_ID': 'EL TORITO SPECIFICATION', 'VERSION': 'Joliet Extension', 'LABEL': 'Endless-OS-Nightly-base', 'TYPE': 'iso9660', 'USAGE': 'filesystem', 'PTTYPE': 'dos'}

There is no PART_ENTRY_SCHEME entry here, yet the code in line 598 expects one and causes a Python KeyError. The data structure does have PTTYPE which seems similar ?

This may be related to blkid version? Here's what we have in eos7:

# blkid --version
blkid from util-linux 2.40.4  (libblkid 2.40.4, 13-Jan-2025)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions