1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

SystemServer: Boot to text mode if there are no device nodes at /dev/gpu

Otherwise, WindowServer will simply crash and fail due to no hardware to
utilize.
This commit is contained in:
Liav A 2022-05-06 01:05:43 +03:00 committed by Linus Groh
parent a0a1ac0656
commit fb7d9186b2

View file

@ -72,6 +72,14 @@ static ErrorOr<void> determine_system_mode()
g_system_mode = system_mode;
dbgln("Read system_mode: {}", g_system_mode);
struct stat file_state;
int rc = lstat("/dev/gpu/connector0", &file_state);
if (rc != 0 && g_system_mode == "graphical") {
dbgln("WARNING: No device nodes at /dev/gpu/ directory. This is probably a sign of disabled graphics functionality.");
dbgln("To cope with this, I'll turn off graphical mode.");
g_system_mode = "text";
}
return {};
}