Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/modules/hwinfo/hardware.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2493 - (hide annotations) (download)
Thu Sep 10 13:43:13 2015 UTC (8 years, 8 months ago) by niro
File size: 2061 byte(s)
-fixed a typo minitor->monitor and print more debug messages
1 niro 2487 # $Id$
2    
3     require hwdetection
4     require mysql
5    
6     set_hardware_detect()
7     {
8     local serial="${CLASS_ARGV[0]}"
9    
10     local cmd
11     local netcard_driver
12     local graphic_driver
13     local monitor_info
14     local monitor_resolution
15    
16     nsslsay_queue_init
17     nsslsay_queue_add "nocolors"
18     nsslsay_queue_add "get hardware.detect driver netcard"
19     netcard_driver=$(control_client "${serial}" run-queue)
20     if [[ -n ${netcard_driver} ]]
21     then
22     decho "netcard_driver='${netcard_driver}'"
23     import_resource cfg_network "${serial}" module "${netcard_driver}"
24     else
25     decho "no netcard_driver found"
26     fi
27 niro 2488 if [[ -z $(mysqldo "select networking from cfg_network where serial=${serial};") ]]
28     then
29     # set network to dhcp
30 niro 2493 decho "networking='dhcp'"
31 niro 2488 import_resource cfg_network "${serial}" networking "dhcp"
32     fi
33     if [[ -z $(mysqldo "select hostname from cfg_network where serial=${serial};") ]]
34     then
35     # set hostname to MCORE_DEFAULT_HOSTNAME
36 niro 2493 decho "hostname='${MCORE_DEFAULT_HOSTNAME}'"
37 niro 2488 import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}"
38     fi
39 niro 2491 if [[ -z $(mysqldo "select domain from cfg_network where serial=${serial};") ]]
40     then
41     # set domain to MCORE_DEFAULT_DOMAIN
42 niro 2493 decho "hostname='${MCORE_DEFAULT_DOMAIN}'"
43 niro 2491 import_resource cfg_network "${serial}" domain "${MCORE_DEFAULT_DOMAIN}"
44     fi
45 niro 2487
46     nsslsay_queue_init
47     nsslsay_queue_add "nocolors"
48     nsslsay_queue_add "get hardware.detect driver graphic"
49     graphic_driver=$(control_client "${serial}" run-queue)
50     if [[ -n ${graphic_driver} ]]
51     then
52     decho "graphic_driver='${graphic_driver}'"
53     import_resource cfg_graphic "${serial}" module "${graphic_driver}"
54     else
55     decho "no graphic_driver found"
56     fi
57    
58     nsslsay_queue_init
59     nsslsay_queue_add "nocolors"
60 niro 2493 nsslsay_queue_add "get hardware.detect info monitor"
61 niro 2487 monitor_info=$(control_client "${serial}" run-queue)
62     monitor_resolution="${monitor_info##*;}"
63     if [[ -n ${monitor_resolution} ]]
64     then
65     decho "monitor_resolution='${monitor_resolution}'"
66     import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
67     else
68     decho "no monitor_resolution found"
69     fi
70     }