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 2755 - (hide annotations) (download)
Tue Feb 2 14:11:44 2016 UTC (8 years, 3 months ago) by niro
File size: 1167 byte(s)
-split firstboot/hardware configuration from hwdetection class to its corresponding module
1 niro 2487 # $Id$
2    
3 niro 2497 provide hardware
4 niro 2487 require hwdetection
5     require mysql
6    
7 niro 2499 run_hardware_detect()
8 niro 2487 {
9 niro 2499 local serial="$1"
10 niro 2487
11     local cmd
12     local netcard_driver
13 niro 2496 local networking
14     local hostname
15     local domain
16 niro 2487 local graphic_driver
17     local monitor_info
18     local monitor_resolution
19 niro 2500 local keymap
20 niro 2497 local hwdetected
21 niro 2502 local auth
22 niro 2500 local i
23 niro 2487
24 niro 2499 if [[ -z ${serial} ]]
25     then
26     decho "No serial given"
27     return 1
28     fi
29    
30 niro 2497 # first check if hardware detect was already done
31     hwdetected=$(mysqldo "select hwdetected from client_serials where serial=${serial};")
32     if [[ ${hwdetected} = 1 ]]
33     then
34     decho "hardware detection already run, aborting"
35     return 0
36 niro 2498 else
37     decho "running hardware detection"
38 niro 2497 fi
39    
40 niro 2755 # run all pushed firstboot configuration snippets
41     run_push_firstboot "${serial}"
42 niro 2487
43 niro 2497 # update the hwdetected flags
44 niro 2499 import_resource client_serials "${serial}" hwdetected 1
45 niro 2487 }
46 niro 2499
47     set_hardware_detect()
48     {
49     local serial="${CLASS_ARGV[0]}"
50    
51     local cmd
52     local netcard_driver
53     local networking
54     local hostname
55     local domain
56     local graphic_driver
57     local monitor_info
58     local monitor_resolution
59     local hwdetected
60    
61     if [[ -z ${serial} ]]
62     then
63     eecho "No serial given"
64     return 1
65     fi
66    
67     run_hardware_detect "${serial}"
68     }