[elbe-devel] [PATCH v2 3/4] hdimg: change mountpoint of efi partition to /boot/efi

Martin Kaistra martin.kaistra at linutronix.de
Wed Mar 28 14:16:55 CEST 2018


Instead of installing EFI to /boot, use /boot/efi which is the
default in Debian.

Signed-off-by: Martin Kaistra <martin.kaistra at linutronix.de>
---
 elbepack/hdimg.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index ddc3138c..2fc042d9 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -190,12 +190,16 @@ class grubinstaller_base(object):
         self.outf = outf
         self.root = None
         self.boot = None
+        self.boot_efi = None
         self.fw_type = fw_type
 
     def set_boot_entry(self, entry):
         print("setting boot entry")
         self.boot = entry
 
+    def set_boot_efi_entry(self, entry):
+        self.boot_efi = entry
+
     def set_root_entry(self, entry):
         self.root = entry
 
@@ -225,6 +229,12 @@ class grubinstaller202(grubinstaller_base):
                     (self.boot.partnum, os.path.join(
                         imagemnt, "boot")))
 
+            if self.boot_efi:
+                self.outf.do(
+                    'mount /dev/mapper/poop0p%d %s' %
+                    (self.boot_efi.partnum, os.path.join(
+                        imagemnt, "boot/efi")))
+
             self.outf.do(
                 "mount --bind /dev %s" %
                 os.path.join(
@@ -253,7 +263,7 @@ class grubinstaller202(grubinstaller_base):
             if self.fw_type == "efi":
                 self.outf.do(
                     "chroot %s grub-install --target=x86_64-efi --removable "
-                    "--efi-directory=/boot --no-floppy /dev/poop0" %
+                    "--no-floppy /dev/poop0" %
                     (imagemnt))
             else:
                 self.outf.do(
@@ -281,6 +291,11 @@ class grubinstaller202(grubinstaller_base):
                     "sys"),
                 allow_fail=True)
 
+            if self.boot_efi:
+                self.outf.do(
+                    'umount /dev/mapper/poop0p%d' %
+                    self.boot_efi.partnum, allow_fail=True)
+
             if self.boot:
                 self.outf.do(
                     'umount /dev/mapper/poop0p%d' %
@@ -437,6 +452,8 @@ def create_label(outf, disk, part, ppart, fslabel, target, grub):
         grub.set_root_entry(entry)
     elif entry.mountpoint == "/boot":
         grub.set_boot_entry(entry)
+    elif entry.mountpoint == "/boot/efi":
+        grub.set_boot_efi_entry(entry)
 
     entry.losetup(outf, "loop0")
     outf.do(
-- 
2.11.0




More information about the elbe-devel mailing list