mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:17:34 +00:00
Kernel: Rename /sys/kernel/variables => /sys/kernel/conf
The name "variables" is a bit awkward and what the directory entries are really about is kernel configuration so let's make it clear with the new name.
This commit is contained in:
parent
3151099b21
commit
751aae77bc
24 changed files with 99 additions and 99 deletions
|
@ -322,7 +322,7 @@ void KeyboardSettingsWidget::write_caps_lock_to_ctrl_sys_variable(bool caps_lock
|
|||
|
||||
ErrorOr<bool> KeyboardSettingsWidget::read_caps_lock_to_ctrl_sys_variable()
|
||||
{
|
||||
auto file = TRY(Core::File::open("/sys/kernel/variables/caps_lock_to_ctrl"sv, Core::File::OpenMode::Read));
|
||||
auto file = TRY(Core::File::open("/sys/kernel/conf/caps_lock_to_ctrl"sv, Core::File::OpenMode::Read));
|
||||
auto buffer = TRY(file->read_until_eof());
|
||||
StringView contents_string((char const*)buffer.data(), min(1, buffer.size()));
|
||||
return contents_string == "1";
|
||||
|
|
|
@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/bin/keymap", "x"));
|
||||
TRY(Core::System::unveil("/bin/sysctl", "x"));
|
||||
TRY(Core::System::unveil("/sys/kernel/keymap", "r"));
|
||||
TRY(Core::System::unveil("/sys/kernel/variables/caps_lock_to_ctrl", "r"));
|
||||
TRY(Core::System::unveil("/sys/kernel/conf/caps_lock_to_ctrl", "r"));
|
||||
TRY(Core::System::unveil("/etc/Keyboard.ini", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
|
@ -501,7 +501,7 @@ static ErrorOr<void> create_tmp_coredump_directory()
|
|||
static ErrorOr<void> set_default_coredump_directory()
|
||||
{
|
||||
dbgln("Setting /tmp/coredump as the coredump directory");
|
||||
auto sysfs_coredump_directory_variable_fd = TRY(Core::System::open("/sys/kernel/variables/coredump_directory"sv, O_RDWR));
|
||||
auto sysfs_coredump_directory_variable_fd = TRY(Core::System::open("/sys/kernel/conf/coredump_directory"sv, O_RDWR));
|
||||
ScopeGuard close_on_exit([&] {
|
||||
close(sysfs_coredump_directory_variable_fd);
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ static bool s_set_variable = false;
|
|||
|
||||
static DeprecatedString get_variable(StringView name)
|
||||
{
|
||||
auto path = DeprecatedString::formatted("/sys/kernel/variables/{}", name);
|
||||
auto path = DeprecatedString::formatted("/sys/kernel/conf/{}", name);
|
||||
auto file = Core::File::open(path, Core::File::OpenMode::Read);
|
||||
if (file.is_error()) {
|
||||
warnln("Failed to open {}: {}", path, file.error());
|
||||
|
@ -42,7 +42,7 @@ static bool write_variable(StringView name, StringView value)
|
|||
auto old_value = get_variable(name);
|
||||
if (old_value.is_null())
|
||||
return false;
|
||||
auto path = DeprecatedString::formatted("/sys/kernel/variables/{}", name);
|
||||
auto path = DeprecatedString::formatted("/sys/kernel/conf/{}", name);
|
||||
auto file = Core::File::open(path, Core::File::OpenMode::Write);
|
||||
if (file.is_error()) {
|
||||
warnln("Failed to open {}: {}", path, file.error());
|
||||
|
@ -80,7 +80,7 @@ static int handle_variables(Vector<StringView> const& variables)
|
|||
|
||||
static int handle_show_all()
|
||||
{
|
||||
Core::DirIterator di("/sys/kernel/variables", Core::DirIterator::SkipDots);
|
||||
Core::DirIterator di("/sys/kernel/conf", Core::DirIterator::SkipDots);
|
||||
if (di.has_error()) {
|
||||
outln("DirIterator: {}", di.error());
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue