1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 13:31:36 +03:00
mobile-nixos/boot/init/tasks/udev.rb
2020-02-03 16:19:10 -05:00

34 lines
649 B
Ruby

# Runs udev daemon
class Tasks::UDev < SingletonTask
def initialize()
add_dependency(:SingletonTask, :Environment)
add_dependency(:Files, "/dev/null")
add_dependency(:Files, "/proc/cmdline")
add_dependency(:Files, "/run")
end
def udevadm(*args)
System.run("udevadm", *args)
end
def run()
udevd
udevadm("trigger", "--action=add")
udevadm("settle")
end
def udevd()
*args = []
args << "--debug" if debug?
System.run("systemd-udevd", "--daemon", *args)
end
# TODO: Allow configuring its debug state
def debug?
false
end
# TODO: teardown
# udevadm control --exit
end