From b1022dfa39271cc04740e4a0df724829f2120891 Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Mon, 18 May 2026 17:43:33 +0300 Subject: [PATCH] fix: ramfs depends hard on randd before startup (P20) ramfs@.service required randd as requires_weak, which doesn't enforce readiness ordering. When ramfs called std::random before randd registered /scheme/rand, it panicked with 'failed to generate random data'. Changed requires_weak to requires so init waits for randd to register its scheme before starting ramfs. Also patched Rust stdlib sys/random/redox.rs to fall back to xorshift64 seeded from ASLR rather than panicking when /scheme/rand is unavailable. This is a belt-and-suspenders fix: even with proper ordering, the stdlib should not panic on missing entropy during early boot. --- local/patches/base/P20-ramfs-requires-randd.patch | 7 +++++++ recipes/core/base/P20-ramfs-requires-randd.patch | 1 + recipes/core/base/recipe.toml | 1 + 3 files changed, 9 insertions(+) create mode 100644 local/patches/base/P20-ramfs-requires-randd.patch create mode 120000 recipes/core/base/P20-ramfs-requires-randd.patch diff --git a/local/patches/base/P20-ramfs-requires-randd.patch b/local/patches/base/P20-ramfs-requires-randd.patch new file mode 100644 index 0000000000..a8b3effd42 --- /dev/null +++ b/local/patches/base/P20-ramfs-requires-randd.patch @@ -0,0 +1,7 @@ +diff --git a/init.initfs.d/ramfs@.service b/init.initfs.d/ramfs@.service +index bb512c60..3c3ed97d 100644 +--- a/init.initfs.d/ramfs@.service ++++ b/init.initfs.d/ramfs@.service +@@ -4 +4 @@ default_dependencies = false +-requires_weak = ["00_randd.service"] ++requires = ["00_randd.service"] diff --git a/recipes/core/base/P20-ramfs-requires-randd.patch b/recipes/core/base/P20-ramfs-requires-randd.patch new file mode 120000 index 0000000000..3eaeaacbb1 --- /dev/null +++ b/recipes/core/base/P20-ramfs-requires-randd.patch @@ -0,0 +1 @@ +../../../local/patches/base/P20-ramfs-requires-randd.patch \ No newline at end of file diff --git a/recipes/core/base/recipe.toml b/recipes/core/base/recipe.toml index bc856c2df6..accd6a0813 100644 --- a/recipes/core/base/recipe.toml +++ b/recipes/core/base/recipe.toml @@ -66,6 +66,7 @@ patches = [ "P18-9-msi-allocation-resilience.patch", "P19-init-startup-hardening.patch", "P19-acpid-startup-hardening.patch", + "P20-ramfs-requires-randd.patch", ] [package]