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