[systemd-devel] Systemd udev add tag for boot device
Lennart Poettering
lennart at poettering.net
Mon Jan 13 09:42:42 UTC 2020
eOn Fr, 06.12.19 14:35, Boyce, Kevin P [US] (AS) (Kevin.Boyce at ngc.com) wrote:
> Good Morning List,
>
> Does anyone know of a good way to use udev to set a TAG property on every partition of a disk that was used to boot the system?
>
> In other words, I want a udev rule that adds a TAG to every
> partition on the same disk /boot was found on containing the running
> kernel and intiramfs.
On EFI systems with compliant GPT boot loaders
systemd-gpt-auto-generator implements something like that.
But in the general case: the information which boot device was used is
not available, unless the boot loader explicitly passes this
information somewhow.
We generally recommend that EFI boot loaders at least pass this
information via the LoaderDevicePartUUID EFI variable, see this spec
for details:
https://systemd.io/BOOT_LOADER_INTERFACE
For non-EFI there's no spec like this, since there's no generic way to
pass arbitrary data from boot loader to OS, sorry.
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list