summaryrefslogtreecommitdiff
path: root/rules.d
diff options
context:
space:
mode:
authorŁukasz Stelmach <stlman@poczta.fm>2020-06-24 19:24:13 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-25 18:40:45 +0200
commitfdf3e48c447a6e0d810563a641ef28b98d3f9d8c (patch)
tree35fe88c725d09b78c3a9d5bc6284bb4f4773097e /rules.d
parent6d88513e6b4fe36f59d3c5702a22ab796dea7852 (diff)
downloadsystemd-fdf3e48c447a6e0d810563a641ef28b98d3f9d8c.tar.gz
udev: split attribute assignment for MMC cards
Some cards have names consisting only of whitespace characters which prevents the original rule from matching and assigning ID_SERIAL properly. With the split rules ID_SERIAL and ID_NAME are assigned independently and the symlink is created only if both are available the same way it has worked for partitions.
Diffstat (limited to 'rules.d')
-rw-r--r--rules.d/60-persistent-storage.rules5
1 files changed, 3 insertions, 2 deletions
diff --git a/rules.d/60-persistent-storage.rules b/rules.d/60-persistent-storage.rules
index 821e9db86f..fc7f733e20 100644
--- a/rules.d/60-persistent-storage.rules
+++ b/rules.d/60-persistent-storage.rules
@@ -76,8 +76,9 @@ KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
# MMC
-KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", \
- ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
+KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}"
+KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ENV{ID_NAME}="$attr{name}"
+KERNEL=="mmcblk[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
KERNEL=="mmcblk[0-9]p[0-9]*", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
# UBI-MTD