diff --git a/boot/init/tasks/modules.rb b/boot/init/tasks/modules.rb index b3789fc3..c14a0090 100644 --- a/boot/init/tasks/modules.rb +++ b/boot/init/tasks/modules.rb @@ -1,5 +1,6 @@ class Tasks::Modules < Task MODULES_PATH = "/lib/modules" + SYS_MODPROBE_PATH = "/proc/sys/kernel/modprobe" def initialize(*modules) add_dependency(:Files, MODULES_PATH) add_dependency(:Target, :Environment) @@ -10,7 +11,12 @@ class Tasks::Modules < Task end def run() - System.write("/proc/sys/kernel/modprobe", System.which("modprobe")) + unless File.exists?(SYS_MODPROBE_PATH) + $logger.warn("Could not tell the path to modprobe to the kernel.") + $logger.warn("('#{SYS_MODPROBE_PATH}' is missing.)") + return + end + System.write(SYS_MODPROBE_PATH, System.which("modprobe")) @modules.each do |mod| begin System.run("modprobe", mod)