]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
rules: do not use blkid builtin if built without blkid support
authorDmitry V. Levin <ldv@strace.io>
Tue, 7 Mar 2023 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@strace.io>
Wed, 8 Mar 2023 18:55:40 +0000 (18:55 +0000)
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

rules.d/60-persistent-storage.rules.in [moved from rules.d/60-persistent-storage.rules with 99% similarity]
rules.d/meson.build

similarity index 99%
rename from rules.d/60-persistent-storage.rules
rename to rules.d/60-persistent-storage.rules.in
index 3265cd23c5f7a84f77ae3340c913c9ca24c0695f..498b24c22d33e09f76a6598cecc7932827ca1ff3 100644 (file)
@@ -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}"
index cba9dd4cc42871caf47938a7b275757100d71b1c..09edd58da2a765fb0594fe6944719cb490aba253 100644 (file)
@@ -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'],