1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
From d081c0284d061290b2fe56b78c688a8d133b40b4 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Mon, 1 Jul 2019 10:55:12 +0800
Subject: [PATCH] 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 <ovidiu.panait@windriver.com>
Imporve the fix which is compatible with OE
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Replace util.getSysroot() with conf.target.system_root.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Rebase for anaconda 34.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Replace the last util.getSysroot() with conf.target.system_root, and
rebase since 0052-invoke-grub-install-to-generate-efi-filesystem.patch
updated.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
pyanaconda/modules/storage/bootloader/efi.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py
index a61c884f05..819b9f82a6 100644
--- a/pyanaconda/modules/storage/bootloader/efi.py
+++ b/pyanaconda/modules/storage/bootloader/efi.py
@@ -136,10 +136,24 @@ class EFIBase(object):
f.write('grub-mkimage -c /tmp/load.cfg $@ search_fs_uuid\n')
os.chmod(conf.target.system_root + "/tmp/grub-mkimage-wrapper.sh", 0o755)
+ if self._is_32bit_firmware:
+ if os.path.exists(conf.target.system_root + "/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(conf.target.system_root + "/usr/lib64/grub/x86_64-efi"):
+ mod_path = "/usr/lib64/grub/x86_64-efi"
+ elif os.path.exists(conf.target.system_root + "/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.execWithRedirect("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/"],
root=conf.target.system_root)
if rc:
--
2.7.4
|