From a8ea4cbcc8337e0fd4d423201794891fdf6e8677 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Mar 2007 11:13:15 +0000 Subject: [PATCH] * Scan /proc/sys/kernel/modprobe for roots to prevent the kernel modules for the running kernel from being garbage-collected. Idem for /proc/sys/kernel/fbsplash. --- scripts/find-runtime-roots.pl.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/find-runtime-roots.pl.in b/scripts/find-runtime-roots.pl.in index 11c96e8b23..64c17419ff 100644 --- a/scripts/find-runtime-roots.pl.in +++ b/scripts/find-runtime-roots.pl.in @@ -56,3 +56,20 @@ sub lsof { readProc; lsof; + + +sub readFile { + my $path = shift; + if (-e $path) { + if (open FILE, "$path") { + while () { + print; + } + close FILE; + } + } +} + +# This is rather NixOS-specific, so it probably shouldn't be here. +readFile "/proc/sys/kernel/modprobe"; +readFile "/proc/sys/kernel/fbsplash";