Ubuntu 14.04 中 /etc/init/udev-fallback-graphics.conf 的用途是什么?

Ubuntu 14.04 中 /etc/init/udev-fallback-graphics.conf 的用途是什么?

Ubuntu 14.04 LTS 中的 upstart 配置 /etc/init/udev-fallback-graphics.conf(如下所示)有什么用途?

# 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
    fi
end script

我认为它很少被调用,除非缺少视频图形驱动程序。如果缺少图形驱动程序,仍然不能保证会modprobe -b -q vesafb成功。如果失败,脚本将退出并返回 modprobe 的返回代码,并且 /var/log/boot.log 将包含类似于以下内容的消息:

 * Starting load fallback graphics devices[74G[[31mfail[39;49m]

该消息信息量不大。upstart 配置中的脚本代码对我来说看起来像是临时拼凑的。如果返回代码表示modprobe失败,我更希望看到显示特定的警告或错误消息,例如,

modprobe -q -b vesafb || echo "No suitable graphics driver found."

相关内容