1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-03 14:47:18 +03:00

boot: Don't fail if we can't tell the kernel about modprobe

(cherry picked from commit 8db27e0c56b3934ebced48a10d749bf24d8cb6e1)
This commit is contained in:
Samuel Dionne-Riel 2022-08-26 19:50:16 -04:00
parent 2f0095af8a
commit 59e3d0386d

View File

@ -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)