From 2d7d6fd17b5122de630aa47e6705ae3d6c14b7b8 Mon Sep 17 00:00:00 2001 From: Anush Elangovan Date: Thu, 17 Nov 2011 14:31:53 -0800 Subject: [PATCH] Enhance build_image to support new grub2 1.99+ BUG=chromium-os:21244 TEST=./build_image works with both old and new grub Change-Id: Idca80f777b7da72da1690bc374a156f910d487b0 Reviewed-on: https://gerrit.chromium.org/gerrit/11876 Reviewed-by: Bill Richardson Tested-by: Anush Elangovan Commit-Ready: Anush Elangovan --- build_library/create_legacy_bootloader_templates.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build_library/create_legacy_bootloader_templates.sh b/build_library/create_legacy_bootloader_templates.sh index 2614bb1cf7..663dadda37 100755 --- a/build_library/create_legacy_bootloader_templates.sh +++ b/build_library/create_legacy_bootloader_templates.sh @@ -146,8 +146,17 @@ EOF # To cover all of our bases, now populate templated boot support for efi. sudo mkdir -p "${FLAGS_to}"/efi/boot - sudo grub-mkimage -p /efi/boot -o "${FLAGS_to}/efi/boot/bootx64.efi" \ - part_gpt fat ext2 normal boot sh chain configfile linux + + if [[ -f /bin/grub2-mkimage ]];then + # Use the newer grub2 1.99+ + sudo grub2-mkimage -p /efi/boot -O x86_64-efi \ + -o "${FLAGS_to}/efi/boot/bootx64.efi" \ + part_gpt fat ext2 hfs hfsplus normal boot chain configfile linux + else + # Remove this else case after a few weeks (sometime in Dec 2011) + sudo grub-mkimage -p /efi/boot -o "${FLAGS_to}/efi/boot/bootx64.efi" \ + part_gpt fat ext2 normal boot sh chain configfile linux + fi # Templated variables: # DMTABLEA, DMTABLEB -> '0 xxxx verity ... ' # This should be replaced during postinst when updating the ESP.