rules: auto-tag host from the SYSTEMD_MACHINE_TAG udev property

When a device carries a SYSTEMD_MACHINE_TAG udev property, tag it for
systemd and pull in systemd-machine-tag@<tag>.service, which adds the
given tag to the host's machine tags. In other words, attaching the
property to a device makes the host auto-tag itself with the specified
machine tag.
This commit is contained in:
Lennart Poettering
2026-06-01 10:56:16 +02:00
parent 432f54118d
commit 4a05010532
+3
View File
@@ -95,4 +95,7 @@ SUBSYSTEM=="tpm", KERNEL=="tpm[0-9]*", TAG+="systemd"
SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP}=="1", \
ENV{SYSTEMD_WANTS}+="systemd-loop@.service"
# A device carrying the SYSTEMD_MACHINE_TAG property auto-tags the host with the specified machine tag.
ENV{SYSTEMD_MACHINE_TAG}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-machine-tag@$env{SYSTEMD_MACHINE_TAG}.service"
LABEL="systemd_end"