[rhel7-branch 1/1] Mount efivarfs during os installation (#1261559)

bcl installerbot-noreply at redhat.com
Wed Sep 9 16:29:56 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

Tools running inside the chroot need access to /sys/firmware/efi/efivars
if it exists on the host. eg. efibootmgr

Resolves: rhbz#1261559
---
 blivet/__init__.py   | 14 +++++++++++++-
 blivet/formats/fs.py |  5 +++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index a469825..49862a3 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -90,6 +90,7 @@ def cb(self, exn):
 from . import arch
 from .flags import flags
 from .platform import platform as _platform
+from .platform import EFI
 from .size import Size
 from .i18n import _
 
@@ -2294,6 +2295,7 @@ def __init__(self, devicetree):
         self._usb = None
         self._selinux = None
         self._run = None
+        self._efivars = None
         self._fstab_swaps = set()
         self.preserveLines = []     # lines we just ignore and preserve
 
@@ -2343,6 +2345,12 @@ def selinux(self):
         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",
@@ -2419,7 +2427,7 @@ def _parseOneLine(self, devspec, mountpoint, fstype, options, _dump="0", _passno
                                       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:
@@ -2587,6 +2595,8 @@ def mountFilesystems(self, rootPath="", readOnly=None, skipRoot=False):
         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:
@@ -2644,6 +2654,8 @@ def umountFilesystems(self, swapoff=True):
         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:
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 2784fbe..bad4624 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1782,3 +1782,8 @@ class USBFS(NoDevFS):
 
 register_device_format(USBFS)
 
+
+class EFIVarFS(NoDevFS):
+    _type = "efivarfs"
+
+register_device_format(EFIVarFS)


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/05b38c3dfbee96ea8e1a1f9a6e078e654986993d


More information about the anaconda-patches mailing list