# fallback-graphics - take actions to initiate fallback graphics
#
# if we have cold plugged everything and not yet seen a valid graphics
# device,
# shove a fallback framebuffer into the mix and hope for the best.

description	"load fallback graphics devices"

# We only want this job to happen once per boot, hence 'startup and ...'.
start on (startup and 
	  (graphics-device-added PRIMARY_DEVICE_FOR_DISPLAY=1
           or drm-device-added PRIMARY_DEVICE_FOR_DISPLAY=1
           or stopped udevtrigger or container))

task

script
    if [ "$PRIMARY_DEVICE_FOR_DISPLAY" = "" ]; then
        modprobe -q -b vesafb || true
    fi
end script
