1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
|
push_firstboot 10_graphic_driver |
4 |
|
push_firstboot 10_graphic_resolution |
5 |
|
|
6 |
|
push_config 10_graphic_driver |
7 |
push_config 10_graphic_resolution |
push_config 10_graphic_resolution |
8 |
push_config 10_graphic_depth |
push_config 10_graphic_depth |
9 |
push_config 10_graphic_module |
#push_config 10_graphic_refresh |
10 |
|
push_config 10_graphic_hdmi |
11 |
|
|
12 |
help_graphic_resolution() |
help_graphic_resolution() |
13 |
{ |
{ |
33 |
control_client "${serial}" help graphic.driver |
control_client "${serial}" help graphic.driver |
34 |
} |
} |
35 |
|
|
36 |
|
help_graphic_hdmi() |
37 |
|
{ |
38 |
|
local serial="${CLASS_ARGV[0]}" |
39 |
|
control_client "${serial}" help graphic.hdmi |
40 |
|
} |
41 |
|
|
42 |
# set_graphic_driver $serial $value |
# set_graphic_driver $serial $value |
43 |
set_graphic_driver() |
set_graphic_driver() |
44 |
{ |
{ |
97 |
import_resource cfg_graphic "${serial}" depth "${value}" |
import_resource cfg_graphic "${serial}" depth "${value}" |
98 |
} |
} |
99 |
|
|
100 |
control_graphic_depth |
control_graphic_depth() |
101 |
{ |
{ |
102 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
103 |
push_config_10_graphic_depth "${serial}" |
push_config_10_graphic_depth "${serial}" |
136 |
value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'") |
value=$(mysqldo "select hz from cfg_graphic where serial='${serial}'") |
137 |
control_client "${serial}" set graphic.resolution "${value}" |
control_client "${serial}" set graphic.resolution "${value}" |
138 |
} |
} |
139 |
|
|
140 |
|
# set_graphic_hdmi $serial $value |
141 |
|
set_graphic_hdmi() |
142 |
|
{ |
143 |
|
local serial="${CLASS_ARGV[0]}" |
144 |
|
local value="${CLASS_ARGV[1]}" |
145 |
|
|
146 |
|
import_resource cfg_graphic "${serial}" hdmi "${value}" |
147 |
|
} |
148 |
|
|
149 |
|
# control_graphic_hdmi $serial |
150 |
|
control_graphic_hdmi() |
151 |
|
{ |
152 |
|
local serial="${CLASS_ARGV[0]}" |
153 |
|
push_config_10_graphic_hdmi "${serial}" |
154 |
|
} |
155 |
|
|
156 |
|
push_config_10_graphic_hdmi() |
157 |
|
{ |
158 |
|
local serial="$1" |
159 |
|
local value |
160 |
|
|
161 |
|
value=$(mysqldo "select hdmi from cfg_graphic where serial='${serial}'") |
162 |
|
control_client "${serial}" set graphic.hdmi "${value}" |
163 |
|
} |
164 |
|
|
165 |
|
push_firstboot_10_graphic_driver() |
166 |
|
{ |
167 |
|
local serial="$1" |
168 |
|
local graphic_driver |
169 |
|
|
170 |
|
if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]] |
171 |
|
then |
172 |
|
nsslsay_queue_init |
173 |
|
nsslsay_queue_add "nocolors" |
174 |
|
nsslsay_queue_add "get hardware.detect driver graphic" |
175 |
|
graphic_driver=$(control_client "${serial}" run-queue) |
176 |
|
if [[ -n ${graphic_driver} ]] |
177 |
|
then |
178 |
|
decho "graphic_driver='${graphic_driver}'" |
179 |
|
import_resource cfg_graphic "${serial}" module "${graphic_driver}" |
180 |
|
else |
181 |
|
decho "no graphic_driver found" |
182 |
|
fi |
183 |
|
else |
184 |
|
# default to runtime autodetection |
185 |
|
graphic_driver="auto" |
186 |
|
import_resource cfg_graphic "${serial}" module "${graphic_driver}" |
187 |
|
fi |
188 |
|
} |
189 |
|
|
190 |
|
push_firstboot_10_graphic_resolution() |
191 |
|
{ |
192 |
|
local serial="$1" |
193 |
|
local monitor_info |
194 |
|
local monitor_resolution |
195 |
|
|
196 |
|
if [[ ${MCORE_GRAPHIC_HWDETECT_DEEP} = 1 ]] |
197 |
|
then |
198 |
|
nsslsay_queue_init |
199 |
|
nsslsay_queue_add "nocolors" |
200 |
|
nsslsay_queue_add "get hardware.detect info monitor" |
201 |
|
monitor_info=$(control_client "${serial}" run-queue) |
202 |
|
monitor_resolution="${monitor_info##*;}" |
203 |
|
if [[ -n ${monitor_resolution} ]] |
204 |
|
then |
205 |
|
decho "monitor_resolution='${monitor_resolution}'" |
206 |
|
import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" |
207 |
|
else |
208 |
|
decho "no monitor_resolution found" |
209 |
|
fi |
210 |
|
else |
211 |
|
monitor_resolution="auto" |
212 |
|
import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" |
213 |
|
fi |
214 |
|
} |