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

34 lines
636 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)
2019-12-23 22:00:39 +03:00
add_dependency(:Files, "/run")
add_dependency(:Mount, "/dev")
add_dependency(:Mount, "/proc")
2019-12-23 07:26:46 +03:00
end
def udevadm(*args)
System.run("udevadm", *args)
end
def run()
2019-12-23 22:00:39 +03:00
udevd
2019-12-23 07:26:46 +03:00
udevadm("trigger", "--action=add")
udevadm("settle")
end
2019-12-23 22:00:39 +03:00
def udevd()
*args = []
args << "--debug" if debug?
System.run("systemd-udevd", "--daemon", *args)
end
# TODO: Allow configuring its debug state
def debug?
false
end
2019-12-23 07:26:46 +03:00
# TODO: teardown
# udevadm control --exit
end