patches and low-level development discussion
 help / color / mirror / code / Atom feed
* Re: [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition?
       [not found]         ` <9ffb84b5-9c96-4899-ad8e-2401f387a3cd@gmail.com>
@ 2025-10-20 18:22           ` Demi Marie Obenour
  2025-10-20 19:10             ` Andrei Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Demi Marie Obenour @ 2025-10-20 18:22 UTC (permalink / raw)
  To: Andrei Borzenkov, Feli Flitzberg, systemd development,
	Spectrum OS Development


[-- Attachment #1.1.1: Type: text/plain, Size: 1380 bytes --]

On 10/20/25 14:20, Andrei Borzenkov wrote:
> 20.10.2025 21:02, Demi Marie Obenour wrote:
>> On 10/20/25 13:57, Andrei Borzenkov wrote:
>>> 20.10.2025 20:33, Demi Marie Obenour wrote:
>>>> On 10/19/25 11:36, Feli Flitzberg wrote:
>>>>> Hi, long time watcher, first time poster. If the bootloader supports the Discoverable Partitions Specification, all that's needed is the correct partition GUID assigned to every partition. After that, you don't need to pass any partitions or use /etc/fstab as the bootloader will read the disk it came from to mount everything. The only major limitation is that your bootloader partition MUST live on the same disk as root and usr, otherwise they won't be found. Hope this helps!
>>>>
>>>> How can the OS know which block device the system was booted from?
>>>>
>>>
>>>
>>> Bootloader compliant with BLI sets the LoaderDevicePartUUID EFI
>>> variable. Otherwise I assume it possible to get the current boot entry
>>> number from the BootCurrent EFI variable and parse the corresponding
>>> BootXXXX entry.
>>
>> Is this EFI variable the partition table UUID (which identifies a device)
>> or a partition UUID (which does not)?
> 
> It is what is printed by lsblk as partuuid.

Unfortunately this isn't what is needed.  Looks like UEFI variable
storage is the best option.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

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

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

* Re: [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition?
  2025-10-20 18:22           ` [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition? Demi Marie Obenour
@ 2025-10-20 19:10             ` Andrei Borzenkov
  2025-10-20 19:45               ` Demi Marie Obenour
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Borzenkov @ 2025-10-20 19:10 UTC (permalink / raw)
  To: Demi Marie Obenour, Feli Flitzberg, systemd development,
	Spectrum OS Development

20.10.2025 21:22, Demi Marie Obenour wrote:
> On 10/20/25 14:20, Andrei Borzenkov wrote:
>> 20.10.2025 21:02, Demi Marie Obenour wrote:
>>> On 10/20/25 13:57, Andrei Borzenkov wrote:
>>>> 20.10.2025 20:33, Demi Marie Obenour wrote:
>>>>> On 10/19/25 11:36, Feli Flitzberg wrote:
>>>>>> Hi, long time watcher, first time poster. If the bootloader supports the Discoverable Partitions Specification, all that's needed is the correct partition GUID assigned to every partition. After that, you don't need to pass any partitions or use /etc/fstab as the bootloader will read the disk it came from to mount everything. The only major limitation is that your bootloader partition MUST live on the same disk as root and usr, otherwise they won't be found. Hope this helps!
>>>>>
>>>>> How can the OS know which block device the system was booted from?
>>>>>
>>>>
>>>>
>>>> Bootloader compliant with BLI sets the LoaderDevicePartUUID EFI
>>>> variable. Otherwise I assume it possible to get the current boot entry
>>>> number from the BootCurrent EFI variable and parse the corresponding
>>>> BootXXXX entry.
>>>
>>> Is this EFI variable the partition table UUID (which identifies a device)
>>> or a partition UUID (which does not)?
>>
>> It is what is printed by lsblk as partuuid.
> 
> Unfortunately this isn't what is needed.  Looks like UEFI variable
> storage is the best option.

Partition UUID is (supposed to be) unique for every partition, so it 
most certainly allows one to identify the device to which it belongs.

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

* Re: [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition?
  2025-10-20 19:10             ` Andrei Borzenkov
@ 2025-10-20 19:45               ` Demi Marie Obenour
  2025-10-20 20:27                 ` Lennart Poettering
  0 siblings, 1 reply; 4+ messages in thread
From: Demi Marie Obenour @ 2025-10-20 19:45 UTC (permalink / raw)
  To: Andrei Borzenkov, Feli Flitzberg, systemd development,
	Spectrum OS Development


[-- Attachment #1.1.1: Type: text/plain, Size: 2140 bytes --]

On 10/20/25 15:10, Andrei Borzenkov wrote:
> 20.10.2025 21:22, Demi Marie Obenour wrote:
>> On 10/20/25 14:20, Andrei Borzenkov wrote:
>>> 20.10.2025 21:02, Demi Marie Obenour wrote:
>>>> On 10/20/25 13:57, Andrei Borzenkov wrote:
>>>>> 20.10.2025 20:33, Demi Marie Obenour wrote:
>>>>>> On 10/19/25 11:36, Feli Flitzberg wrote:
>>>>>>> Hi, long time watcher, first time poster. If the bootloader supports the Discoverable Partitions Specification, all that's needed is the correct partition GUID assigned to every partition. After that, you don't need to pass any partitions or use /etc/fstab as the bootloader will read the disk it came from to mount everything. The only major limitation is that your bootloader partition MUST live on the same disk as root and usr, otherwise they won't be found. Hope this helps!
>>>>>>
>>>>>> How can the OS know which block device the system was booted from?
>>>>>>
>>>>>
>>>>>
>>>>> Bootloader compliant with BLI sets the LoaderDevicePartUUID EFI
>>>>> variable. Otherwise I assume it possible to get the current boot entry
>>>>> number from the BootCurrent EFI variable and parse the corresponding
>>>>> BootXXXX entry.
>>>>
>>>> Is this EFI variable the partition table UUID (which identifies a device)
>>>> or a partition UUID (which does not)?
>>>
>>> It is what is printed by lsblk as partuuid.
>>
>> Unfortunately this isn't what is needed.  Looks like UEFI variable
>> storage is the best option.
> 
> Partition UUID is (supposed to be) unique for every partition, so it 
> most certainly allows one to identify the device to which it belongs.

I mixed up partition UUID and partition *type* UUID.

What is the best way to use it?  The most obvious one requires that
whenever a block device appears, one checks if either:

- This has the correct partition UUID, and a device with the same
  diskseq and the correct partition type UUID has appeared.
- This has the correct partition type UUID, and a device with the
  same diskseq and the correct partition UUID has appeared.

Is there a simpler option?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

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

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

* Re: [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition?
  2025-10-20 19:45               ` Demi Marie Obenour
@ 2025-10-20 20:27                 ` Lennart Poettering
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Poettering @ 2025-10-20 20:27 UTC (permalink / raw)
  To: Demi Marie Obenour
  Cc: Andrei Borzenkov, Feli Flitzberg, systemd development,
	Spectrum OS Development

On Mo, 20.10.25 15:45, Demi Marie Obenour (demiobenour@gmail.com) wrote:

> >> Unfortunately this isn't what is needed.  Looks like UEFI variable
> >> storage is the best option.
> >
> > Partition UUID is (supposed to be) unique for every partition, so it
> > most certainly allows one to identify the device to which it belongs.
>
> I mixed up partition UUID and partition *type* UUID.
>
> What is the best way to use it?  The most obvious one requires that
> whenever a block device appears, one checks if either:
>
> - This has the correct partition UUID, and a device with the same
>   diskseq and the correct partition type UUID has appeared.
> - This has the correct partition type UUID, and a device with the
>   same diskseq and the correct partition UUID has appeared.
>
> Is there a simpler option?

The {Loader,Stub}DevicePartUUID efi var is passed in from the
firmware, which has no concept of a diskseq, hence it's purely a uuid.

systemd v258 and newer make the ESP booted from available via
/dev/disk/by-designator/esp and XBOOTLDR as
/dev/disk/by-designator/xbootldr as symlinks.

Lennart

--
Lennart Poettering, Berlin

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

end of thread, other threads:[~2025-10-20 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <b8a34c88-3dae-4ef2-bbad-0f0392d91a9d@gmail.com>
     [not found] ` <NYeXYP6ztNP_XNX333NJV5dMtyGq-bGAALIW-CF93loyJAuOLu4n3PlWon8IM_25jK090NiqcMQtXx4SVNcJuh3uSHBpCgu4A0aHwFKLK2s=@proton.me>
     [not found]   ` <14b8d7d5-1807-4814-8398-861883ebb3b0@gmail.com>
     [not found]     ` <573228c7-32be-4dcb-93e2-54e9b74c828c@gmail.com>
     [not found]       ` <2c453481-262f-407f-9a92-db3f4284042f@gmail.com>
     [not found]         ` <9ffb84b5-9c96-4899-ad8e-2401f387a3cd@gmail.com>
2025-10-20 18:22           ` [systemd-devel] With UEFI secure boot and dm-verity, how does one find the user data partition? Demi Marie Obenour
2025-10-20 19:10             ` Andrei Borzenkov
2025-10-20 19:45               ` Demi Marie Obenour
2025-10-20 20:27                 ` Lennart Poettering

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).