From dcfa71368fbe3e10d6d2b49790cf3d119e7aa8ce Mon Sep 17 00:00:00 2001
From: Ivan Davidov <davidov.i@gmail.com>
Date: Mon, 4 Dec 2017 02:52:34 +0200
Subject: [PATCH] Better way to handle the 'EFI mixed mode' edge case when
 building 64-bit MLL.

---
 src/02_build_kernel.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh
index c87cdb9a0..5aa78b917 100755
--- a/src/02_build_kernel.sh
+++ b/src/02_build_kernel.sh
@@ -92,12 +92,8 @@ else
   # Disable Apple Properties (Useful for Macs but useless in general)
   echo "CONFIG_APPLE_PROPERTIES=n" >> .config
 
-  # Check if we are building 32-bit kernel. The exit code is '1' when we are
-  # building 64-bit kernel, otherwise the exit code is '0'.
-  grep -q "CONFIG_X86_32=y" .config
-
-  # The '$?' variable holds the exit code of the last issued command.
-  if [ $? = 1 ] ; then
+  # Check if we are building 64-bit kernel.
+  if [ "`grep "CONFIG_X86_64=y" .config`" = "CONFIG_X86_64=y" ] ; then
     # Enable the mixed EFI mode when building 64-bit kernel.
     echo "CONFIG_EFI_MIXED=y" >> .config
   fi