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

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

 



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@xxxxxxxxxx

LIVE labeled disks cannot be stage1 devices (as well as ANACONDA labeled
ones).
---
 pyanaconda/bootloader.py           |    8 +++++++-
 pyanaconda/storage/devicetree.py   |    1 -
 pyanaconda/storage/partitioning.py |   14 +++++++++++---
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index ed67356..f9fa873 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))
@@ -567,7 +573,7 @@ class BootLoader(object):
             log.warning("%s not bootable" % device.name)
 
         # XXX does this need to be here?
-        if getattr(device.format, "label", None) == "ANACONDA":
+        if getattr(device.format, "label", None) in ("ANACONDA", "LIVE"):
             log.info("ignoring anaconda boot disk")
             valid = False
 
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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux