From 4a05010532564ef4d6c6f435bf029eacdf13b5f6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 29 May 2026 18:31:17 +0200 Subject: [PATCH] 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@.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. --- rules.d/99-systemd.rules.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in index 98f483503e..0dfed01dfd 100644 --- a/rules.d/99-systemd.rules.in +++ b/rules.d/99-systemd.rules.in @@ -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"