Files
lxdeviced/misc/rules/0050-blockdev.ron
T
sisungo 5163bdc367 Initial commit
Signed-off-by: sisungo <[email protected]>
2026-09-01 13:01:13 +00:00

55 lines
1.4 KiB
Plaintext

[
// Register information providers that knows block devices
(
when: All([
Match("ACTION", "add"),
Match("SUBSYSTEM", "block"),
Match("DEVNODE", ".*"),
]),
do: [
UseProvider("FSUUID", f("blkid -o value -s UUID {DEVNODE}")),
],
on_error: Continue,
),
(
when: Match("FSUUID", ""),
do: [Unset("FSUUID")],
),
// Create link aliases for block devices
(
when: All([
Match("ACTION", "add"),
Match("SUBSYSTEM", "block"),
Match("PARTUUID", ".+"),
]),
do: [Add("SYMLINKS", f("{DEVROOT}/disk/by-partuuid/{PARTUUID}"))],
),
(
when: All([
Match("ACTION", "add"),
Match("SUBSYSTEM", "block"),
Match("DISKSEQ", ".+"),
Match("DEVTYPE", "disk"),
]),
do: [Add("SYMLINKS", f("{DEVROOT}/disk/by-diskseq/{DISKSEQ}"))],
),
(
when: All([
Match("ACTION", "add"),
Match("SUBSYSTEM", "block"),
Match("FSUUID", ".+"),
]),
do: [Add("SYMLINKS", f("{DEVROOT}/disk/by-uuid/{FSUUID}"))],
),
(
when: All([
Match("ACTION", "add"),
Match("SUBSYSTEM", "block"),
Match("MAJOR", ".+"),
Match("MINOR", ".+"),
]),
do: [Add("SYMLINKS", f("{DEVROOT}/block/{MAJOR}:{MINOR}"))],
),
]