From c1ddff0b0f2b6f2942d2f2c38b992dced8c4f542 Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Thu, 9 Aug 2018 17:32:24 +0800 Subject: [PATCH 65/65] bootloader.py: fix UEFI multilib installation Fix the following UEFI installation errors when installing multilib images on intel-x86-64: 04:17:32,820 INFO program: Running... grub-install --removable --efi-directory=/boot/efi/ --boot-directory=/boot/efi/EFI/BOOT --grub-mkimage=/tmp/grub-mkimage-wrapper.sh /boot/efi/ 04:17:32,838 INFO program: grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory. 04:17:32,839 DEBUG program: Return code: 1 Commit b715a54cc4de86c16c49e28a542aa3b41c792169 [anaconda: generate efi fs at runtime] added a call to target grub-install binary, which would fail to find grub-efi images and modules when trying to install a multilib image on intel-x86-64. Signed-off-by: Ovidiu Panait Imporve the fix which is compatible with OE Upstream-Status: Inappropriate [oe specific] Signed-off-by: Hongxu Jia --- pyanaconda/bootloader.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index 530ff3a..dfce593 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -1815,10 +1815,25 @@ class EFIBase(object): f.write('grub-mkimage -c /tmp/load.cfg $@ search_fs_uuid\n') os.chmod(util.getSysroot() + "/tmp/grub-mkimage-wrapper.sh", 0o755) + if self._is_32bit_firmware: + if os.path.exists(util.getSysroot()+"/usr/lib/grub/i386-efi"): + mod_path = "/usr/lib/grub/i386-efi" + else: + raise BootLoaderError("GRUB2 32-bit libdir not eixst") + + else: + if os.path.exists(util.getSysroot()+"/usr/lib64/grub/x86_64-efi"): + mod_path = "/usr/lib64/grub/x86_64-efi" + elif os.path.exists(util.getSysroot()+"/usr/lib/grub/x86_64-efi"): + mod_path = "/usr/lib/grub/x86_64-efi" + else: + raise BootLoaderError("GRUB2 64-bit libdir not eixst") + rc = util.execInSysroot("grub-install", ["--removable", "--efi-directory=/boot/efi/", "--boot-directory=%s" % self.config_dir, "--grub-mkimage=/tmp/grub-mkimage-wrapper.sh", + "--directory=%s" % mod_path, "/boot/efi/" ]) if rc: -- 2.7.4