From 8a3f75fc247754ef764736f20bb6c24a8a930e8f Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 16 Feb 2019 21:43:10 +0000 Subject: Use $grub_platform to detect EFI mode in bootloader. This allows multibootusb to chain to the main grub.cfg file, regardless of the boot mode. --- lib/MGA/DrakISO/BuildBoot.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/MGA/DrakISO/BuildBoot.pm b/lib/MGA/DrakISO/BuildBoot.pm index ae84c34..367bf6e 100644 --- a/lib/MGA/DrakISO/BuildBoot.pm +++ b/lib/MGA/DrakISO/BuildBoot.pm @@ -353,7 +353,7 @@ sub build_grub2_cfg { " fi", if_($theme_name, "", - " if [ x\$efi == 'xtrue' ] ; then", + " if [ \$grub_platform == 'efi' ] ; then", " set theme=\$grub2/themes/$theme_name/theme-efi.txt", " else", " set theme=\$grub2/themes/$theme_name/theme.txt", @@ -362,7 +362,7 @@ sub build_grub2_cfg { @loadfonts, "", ), - " if [ x\$efi == 'xtrue' ] ; then", + " if [ \$grub_platform == 'efi' ] ; then", " set linux=linuxefi", " set initrd=initrdefi", " else", @@ -404,10 +404,10 @@ sub build_grub2_cfg { join("\n", if_($command eq 'linuxefi', - "if [ x\$efi == 'xtrue' ] ; then", # EFI only + "if [ \$grub_platform == 'efi' ] ; then", # EFI only ), if_($command eq 'linux16', - "if [ x\$efi != 'xtrue' ] ; then", # EFI doesn't support 16-bit + "if [ \$grub_platform != 'efi' ] ; then", # EFI doesn't support 16-bit ), "menuentry $gettext\"$name\" {", " $command $image " . join(' ', get_default_append($build), $append), @@ -540,9 +540,6 @@ sub build_efi_grub2_cfg { "search --no-floppy --set=root -l '" . $build->{media}{label} . "'", "set prefix=(\$root)/boot/grub2", "", - "set efi=true", - "export efi", - "", ". \$prefix/grub.cfg", "", ); -- cgit v1.2.1