boot: Don't fail if we can't tell the kernel about modprobe
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)
