Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2561 by niro, Thu Sep 17 08:20:13 2015 UTC revision 2844 by niro, Fri Nov 16 13:48:00 2018 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  push_config graphic_resolution  push_firstboot 10_graphic_driver
4    push_firstboot 10_graphic_resolution
5    
6    push_config 10_graphic_driver
7    push_config 10_graphic_resolution
8    push_config 10_graphic_depth
9    #push_config 10_graphic_refresh
10    push_config 10_graphic_hdmi
11    
12  help_graphic_resolution()  help_graphic_resolution()
13  {  {
# Line 26  help_graphic_driver() Line 33  help_graphic_driver()
33   control_client "${serial}" help graphic.driver   control_client "${serial}" help graphic.driver
34  }  }
35    
36  # set_graphic_gfxcard $serial $value  help_graphic_hdmi()
37  set_graphic_gfxcard()  {
38     local serial="${CLASS_ARGV[0]}"
39     control_client "${serial}" help graphic.hdmi
40    }
41    
42    # set_graphic_driver $serial $value
43    set_graphic_driver()
44  {  {
45   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
46   local value="${CLASS_ARGV[1]}"   local value="${CLASS_ARGV[1]}"
# Line 35  set_graphic_gfxcard() Line 48  set_graphic_gfxcard()
48   import_resource cfg_graphic "${serial}" module "${value}"   import_resource cfg_graphic "${serial}" module "${value}"
49  }  }
50    
51    control_graphic_driver()
52    {
53     local serial="${CLASS_ARGV[0]}"
54     push_config_10_graphic_driver "${serial}"
55    }
56    
57    push_config_10_graphic_driver()
58    {
59     local serial="$1"
60     local value
61    
62     value=$(mysqldo "select module from cfg_graphic where serial='${serial}'")
63     control_client "${serial}" set graphic.driver "${value}"
64    }
65    
66  # set_graphic_resolution $serial $value  # set_graphic_resolution $serial $value
67  set_graphic_resolution()  set_graphic_resolution()
68  {  {
# Line 48  set_graphic_resolution() Line 76  set_graphic_resolution()
76  control_graphic_resolution()  control_graphic_resolution()
77  {  {
78   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
79   push_config_graphic_resolution "${serial}"   push_config_10_graphic_resolution "${serial}"
80  }  }
81    
82  push_config_graphic_resolution()  push_config_10_graphic_resolution()
83  {  {
84   local serial="$1"   local serial="$1"
85   local value   local value
# Line 69  set_graphic_depth() Line 97  set_graphic_depth()
97   import_resource cfg_graphic "${serial}" depth "${value}"   import_resource cfg_graphic "${serial}" depth "${value}"
98  }  }
99    
100    control_graphic_depth()
101    {
102     local serial="${CLASS_ARGV[0]}"
103     push_config_10_graphic_depth "${serial}"
104    }
105    
106    push_config_10_graphic_depth()
107    {
108     local serial="$1"
109     local value
110    
111     value=$(mysqldo "select depth from cfg_graphic where serial='${serial}'")
112     control_client "${serial}" set graphic.depth "${value}"
113    }
114    
115  # set_graphic_refesh $serial $value  # set_graphic_refesh $serial $value
116  set_graphic_refresh()  set_graphic_refresh()
117  {  {
# Line 82  set_graphic_refresh() Line 125  set_graphic_refresh()
125  control_graphic_refresh()  control_graphic_refresh()
126  {  {
127   local serial="${CLASS_ARGV[0]}"   local serial="${CLASS_ARGV[0]}"
128     push_config_10_graphic_refresh "${serial}"
129    }
130    
131    push_config_10_graphic_refresh()
132    {
133     local serial="$1"
134   local value   local value
135    
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    }

Legend:
Removed from v.2561  
changed lines
  Added in v.2844