[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 8/9] Set EFI mountpoint when using existing partition (#727933)



This reverts 1ea7fa55bab7c9e9955c505fffb01d5ac2c40042 and
adds the mountpoint only when the partition is used. Otherwise
it will pick up EFI boot partitions on unrelated devices.

Don't allow stage1 to be on same device as live. This prevents
it from using the /boot/efi when installing from an EFI bootable
EFI stick. Patch from dlehman redhat com
---
 pyanaconda/bootloader.py           |    6 ++++++
 pyanaconda/storage/devicetree.py   |    1 -
 pyanaconda/storage/partitioning.py |   14 +++++++++++---
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index ed67356..641b8d7 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -537,6 +537,12 @@ class BootLoader(object):
             self.warnings = []
             return valid
 
+        if os.path.exists("/dev/live") and \
+           os.path.realpath("/dev/live") == device.path:
+            self.errors.append(_("The live device cannot be used as the %s")
+                               % description)
+            valid = False
+
         if not self._device_type_match(device, constraint["device_types"]):
             self.errors.append(_("The %s cannot be of type %s")
                                % (description, device.type))
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 92bd261..8e55aad 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1569,7 +1569,6 @@ class DeviceTree(object):
                 efi = formats.getFormat("efi")
                 if efi.minSize <= device.size <= efi.maxSize:
                     args[0] = "efi"
-                    kwargs['mountpoint'] = "/boot/efi"
         elif format_type == "hfs":
             # apple bootstrap magic
             if isinstance(device, PartitionDevice) and device.bootable:
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index cd95c30..03b04b7 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -116,14 +116,22 @@ def _schedulePartitions(storage, disks):
 
         if request.fstype is None:
             request.fstype = storage.defaultFSType
-        elif request.fstype in ("prepboot", "efi") and \
-                storage.bootLoaderDevice:
+        elif request.fstype == "prepboot" and storage.bootLoaderDevice:
             # there should never be a need for more than one of these
             # partitions, so skip them.
-            log.info("skipping unneeded stage1 request")
+            log.info("skipping unneeded stage1 prepboot request")
             log.debug(request)
             log.debug(storage.bootLoaderDevice)
             continue
+        elif request.fstype == "efi" and storage.bootLoaderDevice:
+            # there should never be a need for more than one of these
+            # partitions, so skip them.
+            log.info("skipping unneeded stage1 efi request")
+            log.debug(request)
+            # Set the mountpoint for the existing EFI boot partition
+            storage.bootLoaderDevice.format.mountpoint = "/boot/efi"
+            log.debug(storage.bootLoaderDevice)
+            continue
         elif request.fstype == "biosboot" and storage.anaconda:
             boot_disk = storage.anaconda.bootloader.stage1_drive
             if boot_disk and boot_disk.format.labelType != "gpt":
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]