Module Name: xsrc
Committed By: mrg
Date: Wed Jul 24 07:17:54 UTC 2024
Modified Files:
xsrc/external/mit/xf86-video-vesa/dist/src: vesa.c
Log Message:
don't run on netbsd if booted from UEFI. it doesn't work, and genfb should.
XXX: pullup-10, maybe pullup-9
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c
diff -u xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c:1.12 xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c:1.13
--- xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c:1.12 Sun Jan 8 21:34:50 2023
+++ xsrc/external/mit/xf86-video-vesa/dist/src/vesa.c Wed Jul 24 07:17:54 2024
@@ -64,6 +64,10 @@
#endif
#include "compat-api.h"
+#if defined(__NetBSD__)
+#include <sys/sysctl.h>
+#endif
+
/* Mandatory functions */
static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid);
static void VESAIdentify(int flags);
@@ -485,6 +489,18 @@ VESAPciProbe(DriverPtr drv, int entity_n
return FALSE;
}
#endif
+#if defined(__NetBSD__)
+ {
+ char method[10];
+ size_t len = sizeof(method);
+
+ if (sysctlbyname("machdep.bootmethod", &method, &len, NULL, 0) == 0 &&
+ strcmp(method, "UEFI") == 0) {
+ ErrorF("vesa: Refusing to run, UEFI booted\n");
+ return FALSE;
+ }
+ }
+#endif
pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL,
NULL, NULL, NULL, NULL, NULL);