Skip to content

Commit

Permalink
distro: udev: add rules which creates symlinks in /dev/disk/
Browse files Browse the repository at this point in the history
This change is caused by Ventoy. Ventoy stores .iso file with DTS kernel image
and DTS rootfs image on the partition which is mounted using its label.
So, these changes will create symlinks to filesystem devices in
/dev/disk/by-label.
  • Loading branch information
DaniilKl committed Oct 9, 2023
1 parent 0fceec7 commit 6b2e540
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 44f7c9ae472e8a8ce91dc53168ddbeeac69df077 Mon Sep 17 00:00:00 2001
From: Daniil Klimuk <[email protected]>
Date: Mon, 9 Oct 2023 14:28:41 +0200
Subject: [PATCH] add-device-symlinks-udev

---
localextra.rules | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/localextra.rules b/localextra.rules
index 3d51d3e395d4..5d3a7a6dd50e 100644
--- a/localextra.rules
+++ b/localextra.rules
@@ -21,3 +21,7 @@ KERNEL=="fb0", SYMLINK+="fb"

# Make all input devices read-write to the input group
SUBSYSTEM=="input", GROUP="input", MODE="660"
+
+# Create symlinks to devices in /dev/disk/:
+KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+ENV{ID_FS_LABEL_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem", SYMLINK+="disk/by-label $env{ID_FS_LABEL_ENC}"
--
2.41.0

5 changes: 5 additions & 0 deletions meta-dts-distro/recipes-core/udev/udev-extraconf_1.1.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILESEXTRAPATHS:append := "${THISDIR}/files"

SRC_URI:append = " \
file://0001-add-device-symlinks-udev.patch \
"

0 comments on commit 6b2e540

Please sign in to comment.