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

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