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

23 lines
472 B
Ruby
Raw Normal View History

2019-12-23 07:26:46 +03:00
# 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