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

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