From fc53809803cd2bc2434e312b19a18fa36776da12 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:40 +0200 Subject: Adding upstream version 256. Signed-off-by: Daniel Baumann --- rules.d/99-systemd.rules.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'rules.d/99-systemd.rules.in') diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in index a99eab9..ad0c7e2 100644 --- a/rules.d/99-systemd.rules.in +++ b/rules.d/99-systemd.rules.in @@ -18,19 +18,18 @@ SUBSYSTEM=="ubi", TAG+="systemd" SUBSYSTEM=="block", TAG+="systemd" -# We can't make any conclusions about suspended DM devices so let's just import previous SYSTEMD_READY state and skip other rules -SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}="SYSTEMD_READY" -SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", GOTO="systemd_end" +# When a dm device is first created, it's just an empty container. Ignore it. +# DM_NAME is not set in this case, but it's set on spurious "add" events that occur later. +SUBSYSTEM=="block", ACTION=="add", KERNEL=="dm-*", ENV{DM_NAME}!="?*", ENV{SYSTEMD_READY}="0" -SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" +# DM_UDEV_DISABLE_OTHER_RULES_FLAG==1 means that the device shouldn't be probed. +# Import previous SYSTEMD_READY state. +SUBSYSTEM=="block", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}=="", IMPORT{db}="SYSTEMD_READY" # Ignore encrypted devices with no identified superblock on it, since # we are probably still calling mke2fs or mkswap on it. SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0" -# Explicitly set SYSTEMD_READY=1 for DM devices that don't have it set yet, so that we always have something to import above -SUBSYSTEM=="block", ENV{DM_UUID}=="?*", ENV{SYSTEMD_READY}=="", ENV{SYSTEMD_READY}="1" - # add symlink to GPT root disk SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root" SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks" @@ -85,4 +84,7 @@ SUBSYSTEM=="misc", KERNEL=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="system SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount" +# Pull in tpm2.target whenever /dev/tpmrm* shows up +SUBSYSTEM=="tpmrm", KERNEL=="tpmrm[0-9]*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="tpm2.target" + LABEL="systemd_end" -- cgit v1.2.3