[master 2/2] Don't depend on storage or instClass in EFIGRUB
Peter Jones
pjones at redhat.com
Wed Sep 5 16:50:48 UTC 2012
Resolves: rhbz#853308
---
pyanaconda/bootloader.py | 10 ++++++++--
pyanaconda/install.py | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index ce12c85..e1bc455 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1551,7 +1551,11 @@ class EFIGRUB(GRUB2):
@property
def _config_dir(self):
- return "efi/EFI/%s" % (self.storage.anaconda.instClass.efi_dir,)
+ return "efi/EFI/%s" % (self.efi_dir,)
+
+ def __init__(self, platform=None):
+ super(EFIGRUB, self).__init__(platform=platform)
+ self.efi_dir = 'BOOT'
def efibootmgr(self, *args, **kwargs):
if kwargs.pop("capture", False):
@@ -2132,7 +2136,7 @@ def writeSysconfigKernel(storage, version):
f.write("DEFAULTKERNEL=%s\n" % kernel)
f.close()
-def writeBootLoader(storage, payload):
+def writeBootLoader(storage, payload, instClass):
""" Write bootloader configuration to disk.
When we get here, the bootloader will already have a default linux
@@ -2165,6 +2169,8 @@ def writeBootLoader(storage, payload):
short=base_short_label)
storage.bootloader.add_image(default_image)
storage.bootloader.default = default_image
+ if hasattr(storage.bootloader, 'efi_dir'):
+ storage.bootloader.efi_dir = instClass.efi_dir
# write out /etc/sysconfig/kernel
writeSysconfigKernel(storage, version)
diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index d639df3..36f4831 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -76,7 +76,7 @@ def doInstall(storage, payload, ksdata, instClass):
# Do bootloader.
with progress_report(_("Installing bootloader")):
- writeBootLoader(storage, payload)
+ writeBootLoader(storage, payload, instClass)
# Now run the execute methods of ksdata that require an installed system
# to be present first.
--
1.7.11.4
More information about the anaconda-patches
mailing list