ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Zbigniew Jędrzejewski-Szmek f4a676
From 3d1922335f63c10b50527f210c05e039a51f69de Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek f4a676
From: George McCollister <george.mccollister@gmail.com>
Zbigniew Jędrzejewski-Szmek f4a676
Date: Thu, 25 May 2017 21:13:50 -0500
Zbigniew Jędrzejewski-Szmek f4a676
Subject: [PATCH] rules: Handle MMC boot partitions by-path correctly (#6026)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Many eMMC devices have separate boot partitions that aren't part of the
Zbigniew Jędrzejewski-Szmek f4a676
normal partition table that show up as /dev/mmcblk[0-9]boot[0-9]. These
Zbigniew Jędrzejewski-Szmek f4a676
partitions are generally small (128KB to 16MB) and typically hold a boot
Zbigniew Jędrzejewski-Szmek f4a676
loader, boot loader data or a recovery image. Match these and create
Zbigniew Jędrzejewski-Szmek f4a676
-boot%n by-path symlinks.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Prior to this change by-path symlinks for the main device would be
Zbigniew Jędrzejewski-Szmek f4a676
incorrectly linked to one of the boot partitions.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
For instance before:
Zbigniew Jędrzejewski-Szmek f4a676
/dev/disk/by-path/platform-219c000.usdhc linked to /dev/mmcblk1boot1
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Now:
Zbigniew Jędrzejewski-Szmek f4a676
/dev/disk/by-path/platform-219c000.usdhc links to /dev/mmcblk1
Zbigniew Jędrzejewski-Szmek f4a676
/dev/disk/by-path/platform-219c000.usdhc-boot0 links to /dev/mmcblk1boot0
Zbigniew Jędrzejewski-Szmek f4a676
/dev/disk/by-path/platform-219c000.usdhc-boot1 links to /dev/mmcblk1boot1
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
On systems that support multiple SD/MMC devices it can be essential to
Zbigniew Jędrzejewski-Szmek f4a676
have by-path links to these devices since device names vary depending on
Zbigniew Jędrzejewski-Szmek f4a676
which other devices are connected.
Zbigniew Jędrzejewski-Szmek f4a676
(cherry picked from commit 4e3f07029ad7b86773ce85db422bbce95ac578cf)
Zbigniew Jędrzejewski-Szmek f4a676
---
Zbigniew Jędrzejewski-Szmek f4a676
 rules/60-persistent-storage.rules | 3 ++-
Zbigniew Jędrzejewski-Szmek f4a676
 1 file changed, 2 insertions(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
Zbigniew Jędrzejewski-Szmek f4a676
index 9817e9c64b..d2745f65f4 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/rules/60-persistent-storage.rules
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/rules/60-persistent-storage.rules
Zbigniew Jędrzejewski-Szmek f4a676
@@ -64,7 +64,8 @@ KERNEL=="msblk[0-9]p[0-9]|mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
 # by-path
Zbigniew Jędrzejewski-Szmek f4a676
 ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
Zbigniew Jędrzejewski-Szmek f4a676
-ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
Zbigniew Jędrzejewski-Szmek f4a676
+KERNEL=="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-boot%n"
Zbigniew Jędrzejewski-Szmek f4a676
+KERNEL!="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
Zbigniew Jędrzejewski-Szmek f4a676
 ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
 # legacy virtio-pci by-path links (deprecated)