Blob Blame History Raw
From 07471d58ff89d97ed551a5bfbcbfdfe428849464 Mon Sep 17 00:00:00 2001
From: David Lehman <dlehman@redhat.com>
Date: Thu, 8 Mar 2018 11:43:31 -0500
Subject: [PATCH 1/1] Mark partition live device's disk protected. (#1524700)

---
 pyanaconda/storage/osinstall.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/storage/osinstall.py b/pyanaconda/storage/osinstall.py
index 435c723d9..8f34497e6 100644
--- a/pyanaconda/storage/osinstall.py
+++ b/pyanaconda/storage/osinstall.py
@@ -1701,11 +1701,19 @@ class InstallerStorage(Blivet):
             if " /run/initramfs/live " not in mnt:
                 continue
 
-            live_device_name = mnt.split()[0].split("/")[-1]
-            log.info("%s looks to be the live device; marking as protected",
-                     live_device_name)
-            self.protected_dev_names.append(live_device_name)
-            self.live_backing_device = live_device_name
+            live_device_path = mnt.split()[0]
+            udev_device = udev.get_device(device_node=live_device_path)
+            if udev_device and udev.device_is_partition(udev_device):
+                live_device_name = udev.device_get_partition_disk(udev_device)
+            else:
+                live_device_name = live_device_path.split("/")[-1]
+
+            log.info("resolved live device to %s", live_device_name)
+            if live_device_name:
+                log.info("marking live device %s protected", live_device_name)
+                self.protected_dev_names.append(live_device_name)
+                self.live_backing_device = live_device_name
+
             break
 
     def _mark_protected_device(self, device):
-- 
2.14.3