mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-18 05:21:47 +03:00
23 lines
472 B
Ruby
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
|