summaryrefslogtreecommitdiff
path: root/rules.d
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-03-07 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-03-08 18:55:40 +0000
commitf94e9529fe2c7e1e470b5626e220be5ce443928b (patch)
treedcfcf393d99cdf3d843690fbb2d9a71853143afc /rules.d
parentacdba85e0e2bf229f356ad09a2b880e89224715d (diff)
downloadsystemd-f94e9529fe2c7e1e470b5626e220be5ce443928b.tar.gz
rules: do not use blkid builtin if built without blkid support
When built without blkid, then udev-builtin-blkid is not built, and the verifier warns about the unknown builtin: 60-persistent-storage.rules:114 Unknown builtin command: blkid --hint=session_offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} 60-persistent-storage.rules:117 Unknown builtin command: blkid --noraid 60-persistent-storage.rules:120 Unknown builtin command: blkid 60-persistent-storage.rules: udev rules check failed
Diffstat (limited to 'rules.d')
-rw-r--r--rules.d/60-persistent-storage.rules.in (renamed from rules.d/60-persistent-storage.rules)2
-rw-r--r--rules.d/meson.build2
2 files changed, 3 insertions, 1 deletions
diff --git a/rules.d/60-persistent-storage.rules b/rules.d/60-persistent-storage.rules.in
index 3265cd23c5..498b24c22d 100644
--- a/rules.d/60-persistent-storage.rules
+++ b/rules.d/60-persistent-storage.rules.in
@@ -106,6 +106,7 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH_ATA_COMPAT}=="?*", SYMLINK+="disk/by-path
KERNEL=="vd*[!0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}"
KERNEL=="vd*[0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}-part%n"
+{% if HAVE_BLKID %}
# allow admin to disable probing the filesystem for slow devices like floppy disk drives
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_BLKID_FLAG}=="1", GOTO="persistent_storage_blkid_probe_end"
@@ -120,6 +121,7 @@ KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DAT
KERNEL!="sr*|mmcblk[0-9]boot[0-9]", IMPORT{builtin}="blkid"
LABEL="persistent_storage_blkid_probe_end"
+{% endif %}
# by-label/by-uuid links (filesystem metadata)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
diff --git a/rules.d/meson.build b/rules.d/meson.build
index cba9dd4cc4..09edd58da2 100644
--- a/rules.d/meson.build
+++ b/rules.d/meson.build
@@ -15,7 +15,6 @@ rules = [
'60-input-id.rules',
'60-persistent-alsa.rules',
'60-persistent-input.rules',
- '60-persistent-storage.rules',
'60-persistent-storage-tape.rules',
'60-persistent-v4l.rules',
'60-sensor.rules',
@@ -53,6 +52,7 @@ endforeach
rules_in = [
['50-udev-default.rules'],
+ ['60-persistent-storage.rules'],
['64-btrfs.rules'],
['99-systemd.rules'],