From 8d81e3c0bfa86b9f13a7645f074b8be7b3fa269f Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Wed, 17 Jan 2018 11:30:05 +0800 Subject: [PATCH] 1-install: mount efivarfs earlier --- install/scripts/1-install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install/scripts/1-install b/install/scripts/1-install index 7ffd287..aed38ae 100644 --- a/install/scripts/1-install +++ b/install/scripts/1-install @@ -307,7 +307,6 @@ 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` [ -n "$INSTALL_PREFIX" ] && asrc=$INSTALL_PREFIX || asrc=android-$VER - 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 @@ -356,13 +355,12 @@ install_to() echo -e '\nset winefi=/EFI/Microsoft/Boot/bootmgfw.efi\nsearch --file --no-floppy --set=win ${winefi}\nif [ -e (${win})/${winefi} ]; then\n\tmenuentry 'Windows' --class windows {\n\t\tset root=${win}\n\t\tchainloader (${root})/${winefi}\n\t}\nfi\n' >> $grubcfg # Checking for old EFI entries, removing them and adding new depending on bitness - mount -t efivarfs none /sys/firmware/efi/efivars efibootmgr | grep -Eo ".{0,6}Android-x86" | cut -c1-4 > /tmp/efientries if [ -s /tmp/efientries ]; then dialog --title " Question " --defaultno --yesno "\nEFI boot entries for previous Android-x86 installations were found.\n\nDo you wish to delete them?" 10 61 [ $? -eq 0 ] && while read entry; do efibootmgr -Bb "$entry" > /dev/tty4 2>&1; done < /tmp/efientries fi - if [ "$(cat /sys/firmware/efi/fw_platform_size)" == "32" ]; then + if [ "$efi" = "32" ]; then bootefi=bootia32.efi else bootefi=BOOTx64.EFI @@ -448,6 +446,9 @@ install_hd() do_install() { booted_from=`basename $dev` + efi=$(cat /sys/firmware/efi/fw_platform_size 2> /dev/null) + [ -n "$efi" ] && mount -t efivarfs none /sys/firmware/efi/efivars + until install_hd; do if [ $retval -eq 255 ]; then dialog --title ' Error! ' --yes-label Retry --no-label Reboot \ -- 2.11.0