X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=rules%2Frules.d%2F60-persistent-storage.rules;h=409548893bfafe9f300236c5accb03568e471d98;hp=abb9fce30bad5d5645476f3c66804444e0c9fc9e;hb=f907449eee3f58fafafee0658e80578b1dbb2722;hpb=18c969a12b6b43f1cacd8d00310820392dad51ef diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules index abb9fce30..409548893 100644 --- a/rules/rules.d/60-persistent-storage.rules +++ b/rules/rules.d/60-persistent-storage.rules @@ -10,10 +10,10 @@ ACTION!="add|change", GOTO="persistent_storage_end" SUBSYSTEM!="block", GOTO="persistent_storage_end" # skip rules for inappropriate block devices -KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*|btibm*", GOTO="persistent_storage_end" +KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end" # never access non-cdrom removable ide devices, the drivers are causing event loops on open() -KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end" +KERNEL=="hd*[!0-9]", ATTR{removable}=="1", SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", GOTO="persistent_storage_end" KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end" # ignore partitions that span the entire disk @@ -55,11 +55,14 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" # probe filesystem metadata of optical drives which have a media inserted -KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}=="?*", IMPORT{program}="vol_id --export --skip-raid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" +KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="vol_id --export --skip-raid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" # probe filesystem metadata of disks KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode" +# watch for future changes +KERNEL!="sr*", OPTIONS+="watch" + # 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}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"