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 2488 - (hide annotations) (download)
Thu Sep 10 13:16:57 2015 UTC (8 years, 8 months ago) by niro
File size: 1736 byte(s)
-add more network defaults to the database
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     import_resource cfg_network "${serial}" networking "dhcp"
31     fi
32     if [[ -z $(mysqldo "select hostname from cfg_network where serial=${serial};") ]]
33     then
34     # set hostname to MCORE_DEFAULT_HOSTNAME
35     import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}"
36     fi
37 niro 2487
38     nsslsay_queue_init
39     nsslsay_queue_add "nocolors"
40     nsslsay_queue_add "get hardware.detect driver graphic"
41     graphic_driver=$(control_client "${serial}" run-queue)
42     if [[ -n ${graphic_driver} ]]
43     then
44     decho "graphic_driver='${graphic_driver}'"
45     import_resource cfg_graphic "${serial}" module "${graphic_driver}"
46     else
47     decho "no graphic_driver found"
48     fi
49    
50     nsslsay_queue_init
51     nsslsay_queue_add "nocolors"
52     nsslsay_queue_add "get hardware.detect info minitor"
53     monitor_info=$(control_client "${serial}" run-queue)
54     monitor_resolution="${monitor_info##*;}"
55     if [[ -n ${monitor_resolution} ]]
56     then
57     decho "monitor_resolution='${monitor_resolution}'"
58     import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}"
59     else
60     decho "no monitor_resolution found"
61     fi
62     }