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/graphics.rb
Samuel Dionne-Riel 694513d9f0 boot/init: Adds missing dependency on /dev
Though, this is only *incidental* in that for using the framebuffer the
/dev/ mount point needs to exist for /dev/fb0 to exist.

The Graphics step will succeed without that, but users of the Graphics
step might not.
2020-02-03 16:19:10 -05:00

22 lines
651 B
Ruby

# Ensures graphics have been initialized and are ready to be used.
#
# Currently this only handles the "legacy fbdev" style of framebuffers.
class Tasks::Graphics < SingletonTask
def initialize()
add_dependency(
:Files,
"/sys/class/graphics/fb0/mode",
"/sys/class/graphics/fb0/modes",
)
# This is only incidental to the fact that /dev/fb0 wouldn't exist for
# users of the "Graphics" dependency.
add_dependency(:Mount, "/dev")
end
def run()
mode = File.read("/sys/class/graphics/fb0/modes")
log("Setting framebuffer mode to: #{mode}")
File.write("/sys/class/graphics/fb0/mode", mode)
end
end