--- mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class.in 2015/09/29 11:57:49 2636 +++ mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class.in 2018/11/16 13:47:13 2843 @@ -1,8 +1,12 @@ # $Id$ +push_firstboot 10_graphic_driver +push_firstboot 10_graphic_resolution + +push_config 10_graphic_driver push_config 10_graphic_resolution push_config 10_graphic_depth -push_config 10_graphic_module +#push_config 10_graphic_refresh help_graphic_resolution() { @@ -86,7 +90,7 @@ import_resource cfg_graphic "${serial}" depth "${value}" } -control_graphic_depth +control_graphic_depth() { local serial="${CLASS_ARGV[0]}" push_config_10_graphic_depth "${serial}" @@ -125,3 +129,54 @@ value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'") control_client "${serial}" set graphic.resolution "${value}" } + +push_firstboot_10_graphic_driver() +{ + local serial="$1" + local graphic_driver + + if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]] + then + nsslsay_queue_init + nsslsay_queue_add "nocolors" + nsslsay_queue_add "get hardware.detect driver graphic" + graphic_driver=$(control_client "${serial}" run-queue) + if [[ -n ${graphic_driver} ]] + then + decho "graphic_driver='${graphic_driver}'" + import_resource cfg_graphic "${serial}" module "${graphic_driver}" + else + decho "no graphic_driver found" + fi + else + # default to runtime autodetection + graphic_driver="auto" + import_resource cfg_graphic "${serial}" module "${graphic_driver}" + fi +} + +push_firstboot_10_graphic_resolution() +{ + local serial="$1" + local monitor_info + local monitor_resolution + + if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]] + then + nsslsay_queue_init + nsslsay_queue_add "nocolors" + nsslsay_queue_add "get hardware.detect info monitor" + monitor_info=$(control_client "${serial}" run-queue) + monitor_resolution="${monitor_info##*;}" + if [[ -n ${monitor_resolution} ]] + then + decho "monitor_resolution='${monitor_resolution}'" + import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" + else + decho "no monitor_resolution found" + fi + else + monitor_resolution="auto" + import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" + fi +}