1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-06 05:17:36 +00:00

Kernel+SystemServer: Don't hardcode coredump directory path

Instead, allow userspace to decide on the coredump directory path. By
default, SystemServer sets it to the /tmp/coredump directory, but users
can now change this by writing a new path to the sysfs node at
/sys/kernel/variables/coredump_directory, and also to read this node to
check where coredumps are currently generated at.
This commit is contained in:
Liav A 2022-11-26 14:42:35 +02:00 committed by Andrew Kaster
parent 7dcf8f971b
commit 0bb7c8f4c4
10 changed files with 203 additions and 1 deletions

View file

@ -8,6 +8,7 @@
#include <AK/Try.h>
#include <Kernel/FileSystem/SysFS/Component.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Variables/CapsLockRemap.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Variables/CoredumpDirectory.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Variables/Directory.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Variables/DumpKmallocStack.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Variables/UBSANDeadly.h>
@ -21,6 +22,7 @@ UNMAP_AFTER_INIT NonnullLockRefPtr<SysFSGlobalKernelVariablesDirectory> SysFSGlo
list.append(SysFSCapsLockRemap::must_create(*global_variables_directory));
list.append(SysFSDumpKmallocStacks::must_create(*global_variables_directory));
list.append(SysFSUBSANDeadly::must_create(*global_variables_directory));
list.append(SysFSCoredumpDirectory::must_create(*global_variables_directory));
return {};
}));
return global_variables_directory;