Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2755 - (show 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 # $Id$
2
3 provide hardware
4 require hwdetection
5 require mysql
6
7 run_hardware_detect()
8 {
9 local serial="$1"
10
11 local cmd
12 local netcard_driver
13 local networking
14 local hostname
15 local domain
16 local graphic_driver
17 local monitor_info
18 local monitor_resolution
19 local keymap
20 local hwdetected
21 local auth
22 local i
23
24 if [[ -z ${serial} ]]
25 then
26 decho "No serial given"
27 return 1
28 fi
29
30 # 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 else
37 decho "running hardware detection"
38 fi
39
40 # run all pushed firstboot configuration snippets
41 run_push_firstboot "${serial}"
42
43 # update the hwdetected flags
44 import_resource client_serials "${serial}" hwdetected 1
45 }
46
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 }