udev: generate system-unique storage symlinks using device path
When the same disk image is written to multiple storage units, for
example an external SD card and an internal eMMC, the symlinks in
/dev/disk/by-{label,uuid,partlabel,partuuid}/ are no longer unique, and
will point to the device that is probed last.
Adressing partitions via labels and UUIDs is nice to work with, and
depending on the use case, it might also be more robust than using the
symlinks in /dev/disk/by-path/ containing the partition number. Combine
the two approaches to create unique symlinks containing both the device
path as well as the respective UUIDs or labels, and throw in a symlink
using the devpath and the partition number for the sake of completeness.
For an exemplary GPT-partitioned disk at "platform-
2198000.mmc" with a
partition containing an ext4 file system, this might create symlinks of
the following form:
/dev/disk/by-path/platform-
2198000.mmc-part/by-partnum/1
/dev/disk/by-path/platform-
2198000.mmc-part/by-partuuid/
e5a75233-3b90-4aec-8075-
b4dd7132b48d
/dev/disk/by-path/platform-
2198000.mmc-part/by-partlabel/rootfs
/dev/disk/by-path/platform-
2198000.mmc-part/by-uuid/
b2c92f24-8215-4680-b931-
f423aae5f1c9
/dev/disk/by-path/platform-
2198000.mmc-part/by-label/rootfs
Signed-off-by: Roland Hieber <rhi@pengutronix.de>