From 50d1e09df10e4bfcbd21e111a4450b4a4a83240c Mon Sep 17 00:00:00 2001 From: Om Kumar Date: Thu, 27 Mar 2014 15:37:43 +0530 Subject: [PATCH] Fix Grub configurations for Fedora images built on a UEFI host. The grub install scripts on Fedora have hardcoded checks for /sys/firmware/efi and if the directory exists, it uses efi specific instruction like initrdefi, linuxefi etc. vm element should fix it once the configuration is generated. Closes-bug: #1231946 Change-Id: I888304cb9167b8e074b04ca6c5b2f9143b70d37d --- elements/vm/finalise.d/51-bootloader | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elements/vm/finalise.d/51-bootloader b/elements/vm/finalise.d/51-bootloader index 75d01403..8275bafe 100755 --- a/elements/vm/finalise.d/51-bootloader +++ b/elements/vm/finalise.d/51-bootloader @@ -171,6 +171,10 @@ function install_grub2 { if [ $(lsb_release -rs) = '19' ]; then sed -i "s%UUID=[A-Za-z0-9\-]*%LABEL=cloudimg-rootfs%" /etc/fstab fi + # Fix efi specific instructions in grub config file + if [ -d /sys/firmware/efi ]; then + sed -i 's%\(initrd\|linux\)efi /boot%\1 /boot%g' $GRUB_CFG + fi fi }