2019-12-23 06:32:34 +03:00
|
|
|
# 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",
|
|
|
|
)
|
2019-12-23 23:32:01 +03:00
|
|
|
# This is only incidental to the fact that /dev/fb0 wouldn't exist for
|
|
|
|
# users of the "Graphics" dependency.
|
|
|
|
add_dependency(:Mount, "/dev")
|
2019-12-28 04:43:28 +03:00
|
|
|
|
|
|
|
# Make the Graphics target depend on this task.
|
|
|
|
Targets[:Graphics].add_dependency(:Task, self)
|
2019-12-23 06:32:34 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def run()
|
|
|
|
mode = File.read("/sys/class/graphics/fb0/modes")
|
|
|
|
log("Setting framebuffer mode to: #{mode}")
|
2020-01-21 00:40:21 +03:00
|
|
|
System.write("/sys/class/graphics/fb0/mode", mode)
|
2019-12-23 06:32:34 +03:00
|
|
|
end
|
|
|
|
end
|