From fc73aeba271dfd4711fe8d3b8a9b35f5938fb802 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Fri, 30 Sep 2016 10:50:19 +0800 Subject: [PATCH] 1-install: check which grub should be installed Originally we ask whether to install both legacy grub and efi grub. This may confuse the users. The patch checks if the device is EFI enabled and ask to install the appropriate grub only. --- install/scripts/1-install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/scripts/1-install b/install/scripts/1-install index acb54cd..2f1d6cf 100644 --- a/install/scripts/1-install +++ b/install/scripts/1-install @@ -285,7 +285,8 @@ install_to() cmdline=`sed "s|\(initrd.*img\s*\)||; s|quiet\s*||; s|\(vga=\w\+\?\s*\)||; s|\(DPI=\w\+\?\s*\)||; s|\(INSTALL=\w\+\?\s*\)||; s|\(SRC=\S\+\?\s*\)||; s|\(DEBUG=\w\+\?\s*\)||; s|\(BOOT_IMAGE=\S\+\?\s*\)||; s|\(iso-scan/filename=\S\+\?\s*\)||;" /proc/cmdline` asrc=android-$VER - dialog --title " Confirm " --no-label Skip --defaultno --yesno \ + efi="`dmesg | grep EFI.VGA`" + [ -z "$efi" ] && dialog --title " Confirm " --no-label Skip --defaultno --yesno \ "\n Do you want to install boot loader GRUB?" 7 47 if [ $? -eq 0 ]; then cp -af /grub /hd @@ -299,7 +300,7 @@ install_to() [ $? -ne 0 ] && return 255 fi - dialog --title " Confirm " --no-label Skip --defaultno --yesno \ + [ -n "$efi" ] && dialog --title " Confirm " --no-label Skip --defaultno --yesno \ "\n Do you want to install EFI GRUB2?" 7 39 if [ $? -eq 0 ]; then get_part_info $1 -- 2.11.0