[PATCH] Mount efivarfs under /mnt/sysimage on appropriate platforms

Peter Jones pjones at redhat.com
Thu Dec 18 19:49:15 UTC 2014


Bug 1129435 was fixed in the efibootmgr code, but that code only works
if we've got the newer kernel interface available, which requires
mounting it.  If we don't mount it, we hit the old code path, which
doesn't allow us to create device paths > 1024 bytes.

Signed-off-by: Peter Jones <pjones at redhat.com>
---
 blivet/__init__.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 210d3c6..2c8d26b 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -85,6 +85,7 @@ from . import util
 from . import arch
 from .flags import flags
 from .platform import platform as _platform
+from .platform import EFI
 from .size import Size
 from .i18n import _
 
@@ -2260,6 +2261,7 @@ class FSSet(object):
         self._devshm = None
         self._usb = None
         self._selinux = None
+        self._efivars = None
         self._run = None
         self._fstab_swaps = set()
         self.preserveLines = []     # lines we just ignore and preserve
@@ -2310,6 +2312,12 @@ class FSSet(object):
         return self._selinux
 
     @property
+    def efivars(self):
+        if not self._efivars:
+            self._efivars = NoDevice(fmt=getFormat("efivarfs", device="efivarfs", mountpoint="/sys/firmware/efi/efivars"))
+        return self._efivars
+
+    @property
     def run(self):
         if not self._run:
             self._run = DirectoryDevice("/run",
@@ -2386,7 +2394,8 @@ class FSSet(object):
                                       device=device.path,
                                       exists=True)
         elif mountpoint in ("/proc", "/sys", "/dev/shm", "/dev/pts",
-                            "/sys/fs/selinux", "/proc/bus/usb"):
+                            "/sys/fs/selinux", "/proc/bus/usb",
+                            "/sys/firmware/efi/efivars"):
             # drop these now -- we'll recreate later
             return None
         else:
@@ -2554,6 +2563,8 @@ class FSSet(object):
         devices = list(self.mountpoints.values()) + self.swapDevices
         devices.extend([self.dev, self.devshm, self.devpts, self.sysfs,
                         self.proc, self.selinux, self.usb, self.run])
+        if isinstance(_platform, EFI):
+            devices.append(self.efivars)
         devices.sort(key=lambda d: getattr(d.format, "mountpoint", None))
 
         for device in devices:
@@ -2611,6 +2622,8 @@ class FSSet(object):
         devices = list(self.mountpoints.values()) + self.swapDevices
         devices.extend([self.dev, self.devshm, self.devpts, self.sysfs,
                         self.proc, self.usb, self.selinux, self.run])
+        if isinstance(_platform, EFI):
+            devices.append(self.efivars)
         devices.sort(key=lambda d: getattr(d.format, "mountpoint", None))
         devices.reverse()
         for device in devices:
-- 
2.1.0



More information about the anaconda-patches mailing list