From: Ɓukasz Stelmach Date: Wed, 24 Jun 2020 17:24:13 +0000 (+0200) Subject: udev: split attribute assignment for MMC cards X-Git-Tag: v246-rc1~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fdf3e48c447a6e0d810563a641ef28b98d3f9d8c;p=thirdparty%2Fsystemd.git 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. --- diff --git a/rules.d/60-persistent-storage.rules b/rules.d/60-persistent-storage.rules index 821e9db86f0..fc7f733e200 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