Foxboron / sbctl

:computer: :lock: :key: Secure Boot key manager
MIT License
1.35k stars 71 forks source link

Newest `libblkid` does not report pttype for partitions resulting in `failed to find EFI system partition` #226

Closed fabian-thomas closed 1 year ago

fabian-thomas commented 1 year ago

The latest util-linux and util-linux-libs package on Arch Linux breaks sbctl's detection of the efi partition mount point. From version 2.39 onwards it seems that pttype is not reported for partitions which results in the output of lsblk --json --output NAME,UUID,PARTTYPE,MOUNTPOINT,PTTYPE,FSTYPE reporting null as pttype. I'm not sure if this is a upstream regression or a breaking change.

< 2.39:

{
   "name": "nvme0n1p3",
   "uuid": "0F20-354C",
   "parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
   "mountpoint": "/boot",
   "pttype": "gpt",
   "fstype": "vfat"
}

2.39:

{
   "name": "nvme0n1p3",
   "uuid": "0F20-354C",
   "parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
   "mountpoint": "/boot",
   "pttype": null,
   "fstype": "vfat"
}

Fixing this temporarily would involve removing the pttype check.

Note that this produces the same error as #207 but they are unrelated.

Foxboron commented 1 year ago

Works for me.

λ ~ » lsblk --json --output NAME,UUID,PARTTYPE,MOUNTPOINT,PTTYPE,FSTYPE
{
   "blockdevices": [
      {
         "name": "sda",
         "uuid": null,
         "parttype": null,
         "mountpoint": null,
         "pttype": null,
         "fstype": null
      },{
         "name": "sdb",
         "uuid": null,
         "parttype": null,
         "mountpoint": null,
         "pttype": null,
         "fstype": null
      },{
         "name": "nvme0n1",
         "uuid": "11ff2505-6597-4e47-9d6f-23a0e15c4827",
         "parttype": null,
         "mountpoint": null,
         "pttype": "gpt",
         "fstype": "crypto_LUKS",
         "children": [
            {
               "name": "nvme0n1p1",
               "uuid": "1849-00E6",
               "parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
               "mountpoint": "/efi",
               "pttype": "gpt",
               "fstype": "vfat"
            },{
               "name": "nvme0n1p2",
               "uuid": "96e49890-4b32-41e1-bc11-7d61fcd74510",
               "parttype": "4f68bce3-e8cd-4db1-96e7-fbcaf984b709",
               "mountpoint": null,
               "pttype": "gpt",
               "fstype": "crypto_LUKS",
               "children": [
                  {
                     "name": "root",
                     "uuid": "80ecd9f2-fc0b-4300-89f0-68314415e7b2",
                     "parttype": null,
                     "mountpoint": "/home/.snapshots",
                     "pttype": null,
                     "fstype": "btrfs"
                  }
               ]
            }
         ]
      }
   ]
}
Foxboron commented 1 year ago

However it seems like the format has changed, so that is a proper bug.

fabian-thomas commented 1 year ago

What version of util-linux and util-linux-libs are you on?

Foxboron commented 1 year ago
λ ~ » pacman -Q util-linux util-linux-libs
util-linux 2.39-10
util-linux-libs 2.39-10
fabian-thomas commented 1 year ago

Weird, my output is broken on this exact version.

Foxboron commented 1 year ago

lsblk still relies on udev under the hood to get the partition information, are you sure you have rebooted or udev isn't messing with it?

fabian-thomas commented 1 year ago

Yep, still happens with fully up to date system and reboot. But I only now remembered that I'm running Artix on that machine so that might be where the issue comes from. I unfortunately can't test with Arch Linux util-linux since that depends on libsystemd. But the problem is for sure caused by util-linux, not util-linux-libs.

Foxboron commented 1 year ago

Okay, Artix is not Arch Linux so I can't help you.

This issue tracker is not really for distro support either.