From 67e9ca56ac3e2e4c3b153078900cc44ec9d55120 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 3 Dec 2024 16:08:05 +0200 Subject: [PATCH] Kernel: Create /dev/urandom -> /dev/random symlink Most software uses urandom instead of random so this allows it work normally. --- kernel/kernel/FS/DevFS/FileSystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/kernel/FS/DevFS/FileSystem.cpp b/kernel/kernel/FS/DevFS/FileSystem.cpp index 29b8ca53..3f7ae92d 100644 --- a/kernel/kernel/FS/DevFS/FileSystem.cpp +++ b/kernel/kernel/FS/DevFS/FileSystem.cpp @@ -31,6 +31,10 @@ namespace Kernel s_instance->add_device(MUST(ZeroDevice::create(0666, 0, 0))); s_instance->add_device(MUST(KeyboardDevice::create(0440, 0, 901))); s_instance->add_device(MUST(MouseDevice::create(0440, 0, 901))); + + // create symlink urandom -> random + auto urandom = MUST(TmpSymlinkInode::create_new(DevFileSystem::get(), 0777, 0, 0, "random"_sv)); + s_instance->add_inode("urandom"_sv, urandom); } DevFileSystem& DevFileSystem::get()