1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 05:21:47 +03:00
mobile-nixos/boot/init/tasks/modules.rb

19 lines
410 B
Ruby
Raw Normal View History

2019-12-23 22:06:00 +03:00
class Tasks::Modules < Task
MODULES_PATH = "/lib/modules"
def initialize(*modules)
add_dependency(:Files, MODULES_PATH)
add_dependency(:SingletonTask, :Environment)
@modules = modules
end
def run()
@modules.each do |mod|
begin
System.run("modprobe", mod)
rescue System::CommandError
$logger.warn("Module #{mod} failed to load.")
end
end
end
end