Skip to content

Commit 944803d

Browse files
committed
rules: add mtd/by-name symlinks
Add persistent symlinks for MTD devices like SPI-NOR flash, based on the partition names specified on the cmdline, in a Device Tree, or by other MTD partitioning parser drivers. Using the persistent name can be preferable to using the numbered /dev/mtdX device, as the latter can change depending on probe order or when partitioning has changed.
1 parent 9e7c4e7 commit 944803d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

rules/60-persistent-storage-mtd.rules

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# do not edit this file, it will be overwritten on update
2+
3+
# persistent storage links: /dev/mtd/by-name
4+
5+
ACTION=="remove", GOTO="persistent_storage_mtd_end"
6+
SUBSYSTEM!="mtd", GOTO="persistent_storage_mtd_end"
7+
KERNEL!="mtd[0-9]*", GOTO="persistent_storage_mtd_end"
8+
KERNEL=="mtd[0-9]*ro", GOTO="persistent_storage_mtd_end"
9+
10+
ATTR{name}=="?*", SYMLINK+="mtd/by-name/$attr{name}"
11+
12+
LABEL="persistent_storage_mtd_end"

rules/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dist_udevrules_DATA = \
1717
60-input-id.rules \
1818
60-persistent-alsa.rules \
1919
60-persistent-input.rules \
20+
60-persistent-storage-mtd.rules \
2021
60-persistent-storage-tape.rules \
2122
60-persistent-v4l.rules \
2223
60-sensor.rules \

0 commit comments

Comments
 (0)