sddm: stub VirtualTerminal for Redox (no Linux VT subsystem)

VirtualTerminal.cpp uses the Linux/FreeBSD VT ioctls (VT_ACTIVATE, VT_WAITACTIVE,
VT_SETMODE, KDSETMODE, ...) which Redox does not have -> "VT_ACTIVATE was not
declared". Redox has no VT switching; the greeter runs directly on the
compositor/framebuffer. Add a #if defined(__redox__) branch providing no-op
stubs for the public API (path/currentVt/setUpNewVt/jumpToVt) and skip the
linux/vt.h + linux/kd.h includes. Durable patch.
This commit is contained in:
2026-07-25 01:42:53 +09:00
parent 4ddbdd0590
commit 0e261d956d
2 changed files with 38 additions and 1 deletions
+5 -1
View File
@@ -9,7 +9,11 @@ version = "0.1.0"
[source]
git = "https://github.com/sddm/sddm.git"
rev = "63780fcd79f1dbf81a30eef48c28c699ab15aded"
patches = []
patches = [
# Redox has no Linux/FreeBSD VT subsystem (VT_ACTIVATE/VT_WAITACTIVE/KDSETMODE
# etc.); stub SDDM::VirtualTerminal to no-ops (greeter runs on the compositor).
"redox-virtualterminal-stub.patch",
]
[build]
template = "custom"
@@ -0,0 +1,33 @@
--- a/src/common/VirtualTerminal.cpp
+++ b/src/common/VirtualTerminal.cpp
@@ -29,7 +29,7 @@
#include <signal.h>
#ifdef __FreeBSD__
#include <sys/consio.h>
-#else
+#elif !defined(__redox__)
#include <linux/vt.h>
#include <linux/kd.h>
#endif
@@ -42,6 +42,14 @@
namespace SDDM {
namespace VirtualTerminal {
+#if defined(__redox__)
+ // Redox has no Linux/FreeBSD VT subsystem; the greeter runs directly on
+ // the compositor/framebuffer, so VT enumeration/switching is a no-op.
+ QString path(int vt) { return QStringLiteral("/dev/tty%1").arg(vt); }
+ int currentVt() { return 1; }
+ int setUpNewVt() { return 1; }
+ void jumpToVt(int, bool) { }
+#else
#ifdef __FreeBSD__
static const char *defaultVtPath = "/dev/ttyv0";
@@ -254,5 +262,6 @@
if (vtFd != -1)
close(vtFd);
}
+#endif // !__redox__
}
}