From eb360dd9a1105e2f2a52a514c64a8b131980ae06 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 11 Sep 2024 11:27:09 +0200 Subject: [PATCH] udev: allow persistent storage rules for zram devices The /dev/zramN devices can be used as regular block devices. They are typically used for swap areas, but it would be beneficial to have LABEL and UUID in the udev database to make it more user-friendly for tools such as lsblk or mount (if used with other filesystems). --- rules.d/60-block.rules | 2 +- rules.d/60-persistent-storage.rules.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.d/60-block.rules b/rules.d/60-block.rules index 13f88e92c8..40c26a9ed6 100644 --- a/rules.d/60-block.rules +++ b/rules.d/60-block.rules @@ -9,5 +9,5 @@ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", # watch metadata changes, caused by tools closing the device node which was opened for writing ACTION!="remove", SUBSYSTEM=="block", \ - KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*", \ + KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*", \ OPTIONS+="watch" diff --git a/rules.d/60-persistent-storage.rules.in b/rules.d/60-persistent-storage.rules.in index 76cab7fbc7..de6d4837cd 100644 --- a/rules.d/60-persistent-storage.rules.in +++ b/rules.d/60-persistent-storage.rules.in @@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end" ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end" SUBSYSTEM!="block|ubi", GOTO="persistent_storage_end" -KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*", GOTO="persistent_storage_end" +KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*", GOTO="persistent_storage_end" # ignore partitions that span the entire disk TEST=="whole_disk", GOTO="persistent_storage_end"