From: "Brian C. Lane" <bcl(a)redhat.com>
Tools running inside the chroot need access to /sys/firmware/efi/efivars
if it exists on the host. eg. efibootmgr
---
blivet/formats/fs.py | 6 ++++++
blivet/osinstall.py | 14 +++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 431ce53..fcca8d1 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1297,3 +1297,9 @@ class USBFS(NoDevFS):
_type = "usbfs"
register_device_format(USBFS)
+
+
+class EFIVarFS(NoDevFS):
+ _type = "efivarfs"
+
+register_device_format(EFIVarFS)
diff --git a/blivet/osinstall.py b/blivet/osinstall.py
index bb7c204..24d00fe 100644
--- a/blivet/osinstall.py
+++ b/blivet/osinstall.py
@@ -41,6 +41,7 @@
from .formats import getFormat
from .flags import flags
from .platform import platform as _platform
+from .platform import EFI
from .i18n import _
@@ -265,6 +266,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
@@ -314,6 +316,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",
@@ -390,7 +398,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:
@@ -553,6 +561,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",
""))
for device in devices:
@@ -610,6 +620,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",
""))
devices.reverse()
for device in devices:
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/59c147327873a4be26d6a8986cc0...