ci-test-sample/debian/patches/0092-add-linuxefi.mod-for-x...

37 lines
1.5 KiB
Diff

From: =?utf-8?b?6LCi54Kc?= <xiewei@kylinos.cn>
Date: Tue, 2 Feb 2021 14:16:08 +0800
Subject: add linuxefi.mod for x86_64-efi
---
scripts/build/lb_binary_grub2-efi | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/build/lb_binary_grub2-efi b/scripts/build/lb_binary_grub2-efi
index 5e3e3df..b8a7534 100755
--- a/scripts/build/lb_binary_grub2-efi
+++ b/scripts/build/lb_binary_grub2-efi
@@ -312,11 +312,14 @@ sed -i -e 's|\ $||g' binary/boot/grub/grub.cfg
#kylin create efi.img
KY_EFI=""
KY_EFI_NAME=""
+GRUB_MODS="ext2 fat part_msdos part_gpt search_fs_uuid search_label search_fs_file search normal linux font all_video reboot configfile test iso9660"
+
if [ -d chroot/usr/lib/grub/x86_64-efi ];then
KY_EFI="/usr/lib/grub/x86_64-efi"
KY_EFI_NAME="x86_64-efi"
KY_BOOT_EFI_NAME="BOOTX64.EFI"
KY_GRUB_EFI_NAME="grubx64.efi"
+ GRUB_MODS="${GRUB_MODS} linuxefi"
elif [ -d chroot/usr/lib/grub/arm64-efi ];then
KY_EFI="/usr/lib/grub/arm64-efi"
KY_EFI_NAME="arm64-efi"
@@ -340,7 +343,7 @@ if [ -n "${KY_EFI}" ];then
input_efi_dir=${KY_EFI}
core_efi_img=\$(mktemp)
efi_mount_tmp=\$(mktemp -d)
-grub-mkimage -p /boot/grub -o \${core_efi_img} -O ${KY_EFI_NAME} -d \${input_efi_dir} ext2 fat part_msdos part_gpt search_fs_uuid search_label search_fs_file search normal linux font all_video reboot configfile test iso9660
+grub-mkimage -p /boot/grub -o \${core_efi_img} -O ${KY_EFI_NAME} -d \${input_efi_dir} ${GRUB_MODS}
dd if=/dev/zero of=efi.img bs=1M count=100
mkfs.vfat efi.img
mount -o loop efi.img \${efi_mount_tmp}