http://bugs.gentoo.org/258442 From 1a55ee5297b883ea4b43cdf74ad890873ebe966c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 13 Feb 2009 02:21:10 -0500 Subject: [PATCH] modprobe: remove pointless /sys requirement When modprobe was converted from parsing /proc to parsing /sys, it was not a straight conversion. Instead, a "sanity" check was added early on where modprobe would simply abort doing anything useful if /sys isn't mounted. Unfortunately, this makes modprobe fairly unusable. Considering the kernel itself can invoke modprobe before userspace gets a chance to start the init process (and actually mount /sys), we end up with a chicken and egg issue. Which gets even worse when the kernel keeps running modprobe over and over and the boot output fills up with: modprobe: FATAL: /sys is not mounted. modprobe: FATAL: /sys is not mounted. modprobe: FATAL: /sys is not mounted. modprobe: FATAL: /sys is not mounted. modprobe: FATAL: /sys is not mounted. modprobe: FATAL: /sys is not mounted. Since modprobe itself is already written to handle the case where it cannot figure out whether a given module is loaded (and so was able to run perfectly fine without /proc being mounted), the check is wholly useless. Signed-off-by: Mike Frysinger --- modprobe.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/modprobe.c b/modprobe.c index 022004c..110204b 100644 --- a/modprobe.c +++ b/modprobe.c @@ -1522,11 +1522,6 @@ static void handle_module(const char *modname, const char *cmdline_opts, int flags) { - struct stat finfo; - - if (stat("/sys/module", &finfo) < 0) - fatal("/sys is not mounted.\n"); - if (list_empty(todo_list)) { const char *command; -- 1.6.1.3