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

Martin Kaistra martin.kaistra at linutronix.de
Mon Mar 26 10:10:58 CEST 2018


Instead of installing EFI to /boot, use /boot/efi which is the
default in Debian. With this patch, the grub install function
will only work if the boot partition is mounted at /boot/efi.

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

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index ead4c923..f505208c 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -304,10 +304,11 @@ class grubinstaller202efi(grubinstaller_base):
                 (self.root.partnum, imagemnt))
 
             if self.boot:
-                self.outf.do(
-                    'mount /dev/mapper/poop0p%d %s' %
-                    (self.boot.partnum, os.path.join(
-                        imagemnt, "boot")))
+                if self.boot.mountpoint == "/boot/efi":
+                    self.outf.do(
+                        'mount /dev/mapper/poop0p%d %s' %
+                        (self.boot.partnum, os.path.join(
+                            imagemnt, "boot/efi")))
 
             self.outf.do(
                 "mount --bind /dev %s" %
@@ -336,7 +337,7 @@ class grubinstaller202efi(grubinstaller_base):
 
             self.outf.do(
                 "chroot %s grub-install --target=x86_64-efi "
-                "--efi-directory=/boot --removable --no-floppy /dev/poop0" %
+                "--removable --no-floppy /dev/poop0" %
                 (imagemnt))
 
         finally:
@@ -514,7 +515,7 @@ def create_label(outf, disk, part, ppart, fslabel, target, grub):
 
     if entry.mountpoint == "/":
         grub.set_root_entry(entry)
-    elif entry.mountpoint == "/boot":
+    elif entry.mountpoint == "/boot" or entry.mountpoint == "/boot/efi":
         grub.set_boot_entry(entry)
 
     entry.losetup(outf, "loop0")
-- 
2.11.0




More information about the elbe-devel mailing list