ryantimwilson / rpms / systemd

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