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/udev.rb
2020-02-03 16:19:10 -05:00

23 lines
472 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")
@pid = nil
end
def udevadm(*args)
System.run("udevadm", *args)
end
def run()
@pid = spawn("systemd-udevd", "--daemon")
udevadm("trigger", "--action=add")
udevadm("settle")
end
# TODO: teardown
# udevadm control --exit
end