From 3a7636eb977ed02a909b3fbaab1d20bd84f53102 Mon Sep 17 00:00:00 2001
From: Max Rees <maxcrees@me.com>
Date: Sun, 12 Apr 2020 23:21:04 -0500
Subject: pmmx: fix EFI image generation when building on x86_64 host

When generating a pmmx spin on an x86_64 host, the host's grub-mkimage
is used, which looks in the host's /usr/lib/grub for i386-efi by default
when generating the EFI image. Since this doesn't exist on any of our
x86_64 hosts, use the /usr/lib/grub from the squashfs we just generated
instead. grub-mkimage supports this usage using the -d/--directory
option.

This probably would have been noticed earlier since it generates the
following fatal error:

grub-mkimage: error: cannot open `/usr/lib/grub/i386-efi/moddep.lst': No such file or directory.

But the post scripts are run using "sh" instead of "sh -e", ".", etc
from the main script.
---
 post/arch/pmmx.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/post/arch/pmmx.sh b/post/arch/pmmx.sh
index e68e387..3cc2b68 100755
--- a/post/arch/pmmx.sh
+++ b/post/arch/pmmx.sh
@@ -8,7 +8,7 @@ else
 	grub-mkimage -c x86/early.cfg -v -p boot -o grubcore-stage1.img -O i386-pc biosdisk boot btrfs datetime disk ext2 gfxmenu help iso9660 jfs linux ls luks lvm memdisk nilfs2 normal part_gpt part_msdos png scsi search xfs reboot gfxterm gfxterm_background gfxterm_menu
 	cat /usr/lib/grub/i386-pc/cdboot.img grubcore-stage1.img > cdroot-pmmx/boot/grubcore.img
 
-	grub-mkimage -c x86/early.cfg -v -p boot -o x86/efi32.exe -O i386-efi boot btrfs datetime disk ext2 gfxmenu help iso9660 jfs ls luks lvm memdisk nilfs2 normal part_gpt part_msdos png scsi search xfs linux reboot gfxterm gfxterm_background gfxterm_menu
+	grub-mkimage -d squashroot-pmmx/usr/lib/grub/i386-efi -c x86/early.cfg -v -p boot -o x86/efi32.exe -O i386-efi boot btrfs datetime disk ext2 gfxmenu help iso9660 jfs ls luks lvm memdisk nilfs2 normal part_gpt part_msdos png scsi search xfs linux reboot gfxterm gfxterm_background gfxterm_menu
 fi
 
 cp x86/grub.cfg cdroot-pmmx/boot/grub.cfg
-- 
cgit v1.2.3-70-g09d2