summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-08-29 11:04:23 -0400
committerAdam Jackson <ajax@redhat.com>2018-08-29 14:45:35 -0400
commit2645e0aa9c17c2c966a0533e52ad00510311483e (patch)
tree871100fd660abf54c637e9b0995d5ceeb7c6f7be
parent366622333bc1b81cab6d4aa325a18fcd27bf5db4 (diff)
downloadxorg-driver-xf86-video-vesa-not-on-efi.tar.gz
Refuse to run on UEFI machinesnot-on-efi
No possible good can come of this. v2: Check for .../efi-framebuffer.0 ("is there an EFI framebuffer") instead of /sys/firmware/efi ("is this an EFI machine"). Suggested by Peter Jones. Reviewed-by: Peter Jones <pjones@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/vesa.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vesa.c b/src/vesa.c
index 9b65b9b..af750e2 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -43,7 +43,7 @@
#endif
#include <string.h>
-
+#include <unistd.h>
#include "vesa.h"
/* All drivers initialising the SW cursor need this */
@@ -450,7 +450,14 @@ VESAPciProbe(DriverPtr drv, int entity_num, struct pci_device *dev,
intptr_t match_data)
{
ScrnInfoPtr pScrn;
-
+
+#ifdef __linux__
+ if (access("/sys/devices/platform/efi-framebuffer.0", F_OK) == 0) {
+ ErrorF("vesa: Refusing to run on UEFI\n");
+ return FALSE;
+ }
+#endif
+
pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL,
NULL, NULL, NULL, NULL, NULL);
if (pScrn != NULL) {