Blame SOURCES/0001-Refuse-to-run-on-UEFI-machines.patch

101909
From 2645e0aa9c17c2c966a0533e52ad00510311483e Mon Sep 17 00:00:00 2001
101909
From: Adam Jackson <ajax@redhat.com>
101909
Date: Wed, 29 Aug 2018 11:04:23 -0400
101909
Subject: [PATCH xf86-video-vesa] Refuse to run on UEFI machines
101909
101909
No possible good can come of this.
101909
101909
v2: Check for .../efi-framebuffer.0 ("is there an EFI framebuffer")
101909
instead of /sys/firmware/efi ("is this an EFI machine"). Suggested by
101909
Peter Jones.
101909
101909
Reviewed-by: Peter Jones <pjones@redhat.com>
101909
Signed-off-by: Adam Jackson <ajax@redhat.com>
101909
101909
diff --git a/src/vesa.c b/src/vesa.c
101909
index 9b65b9b..af750e2 100644
101909
--- a/src/vesa.c
101909
+++ b/src/vesa.c
101909
@@ -43,7 +43,7 @@
101909
 #endif
101909
 
101909
 #include <string.h>
101909
-
101909
+#include <unistd.h>
101909
 #include "vesa.h"
101909
 
101909
 /* All drivers initialising the SW cursor need this */
101909
@@ -450,7 +450,14 @@ VESAPciProbe(DriverPtr drv, int entity_num, struct pci_device *dev,
101909
 	     intptr_t match_data)
101909
 {
101909
     ScrnInfoPtr pScrn;
101909
-    
101909
+
101909
+#ifdef __linux__
101909
+    if (access("/sys/devices/platform/efi-framebuffer.0", F_OK) == 0) {
101909
+        ErrorF("vesa: Refusing to run on UEFI\n");
101909
+        return FALSE;
101909
+    }
101909
+#endif
101909
+
101909
     pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, 
101909
 				NULL, NULL, NULL, NULL, NULL);
101909
     if (pScrn != NULL) {
101909
-- 
101909
2.17.1
101909