Compare commits
No commits in common. "c1f0704fa8e214cd2e909e13daa040bd00310e57" and "51214ea1bf9144e2574e850f4f584da76fec65ad" have entirely different histories.
c1f0704fa8
...
51214ea1bf
Binary file not shown.
|
@ -1260,9 +1260,6 @@ namespace Kernel
|
|||
LockGuard _(m_lock);
|
||||
TRY(validate_string_access(path));
|
||||
|
||||
if (!m_credentials.is_superuser())
|
||||
return BAN::Error::from_errno(EPERM);
|
||||
|
||||
auto absolute_path = TRY(absolute_path_of(path));
|
||||
TRY(Input::KeyboardLayout::get().load_from_file(absolute_path));
|
||||
return 0;
|
||||
|
|
|
@ -12,7 +12,6 @@ set(USERSPACE_PROJECTS
|
|||
id
|
||||
init
|
||||
image
|
||||
loadkeys
|
||||
ls
|
||||
meminfo
|
||||
mkdir
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(loadkeys CXX)
|
||||
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(loadkeys ${SOURCES})
|
||||
target_compile_options(loadkeys PUBLIC -O2 -g)
|
||||
target_link_libraries(loadkeys PUBLIC libc)
|
||||
|
||||
add_custom_target(loadkeys-install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/loadkeys ${BANAN_BIN}/
|
||||
DEPENDS loadkeys
|
||||
)
|
|
@ -1,42 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/banan-os.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int try_load_keymap(const char* path)
|
||||
{
|
||||
if (load_keymap(path) == -1)
|
||||
{
|
||||
perror("load_keymap");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stderr, "usage: %s KEYMAP\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct stat st;
|
||||
if (stat(argv[1], &st) == 0)
|
||||
return try_load_keymap(argv[1]);
|
||||
|
||||
char buffer[128];
|
||||
strcpy(buffer, "/usr/share/keymaps/");
|
||||
strcat(buffer, argv[1]);
|
||||
|
||||
if (stat(buffer, &st) == 0)
|
||||
return try_load_keymap(buffer);
|
||||
|
||||
strcat(buffer, ".keymap");
|
||||
|
||||
if (stat(buffer, &st) == 0)
|
||||
return try_load_keymap(buffer);
|
||||
|
||||
fprintf(stderr, "Keymap '%s' not found\n", argv[1]);
|
||||
return 1;
|
||||
}
|
Loading…
Reference in New Issue