Magellan Linux

Contents of /alx-src/branches/alxconf-060/functions/config_modules.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2617 - (show annotations) (download) (as text)
Wed Jul 6 22:04:05 2011 UTC (12 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1281 byte(s)
-fixed wrong variable name $mod -> $module
1 # $Id$
2 # configures printing on the host via mysql db settings
3 # Note must be the first configure script which will be startet
4
5 add_module()
6 {
7 local module="$1"
8 local arg="$2"
9
10 if [[ -n $(find /lib/modules/$(uname -r) -name ${module}.[o,k]*) ]]
11 then
12 if [[ -z ${arg} ]]
13 then
14 addconfig "${module}"
15 else
16 addconfig "${module} ${arg}"
17 fi
18 fi
19 }
20
21 config_modules()
22 {
23 local all_ids
24 local i
25 local CONFIG
26
27 # first of all ids
28 all_ids=$(mysqldo "select id from cfg_modules where serial='${ALX_SERIAL}'")
29
30 # get network module
31 evaluate_table cfg_network
32
33 # get graphic module
34 evaluate_table cfg_graphic
35
36 # location of the modules.autoload file
37 CONFIG="/etc/modules.autoload"
38
39 # clear the old one
40 clearconfig
41
42 # needed for printing:
43 add_module lp
44 add_module parport
45 add_module parport_pc
46 add_module usblp
47
48 if [[ -n ${cfg_network_module} ]]
49 then
50 add_module "${cfg_network_module}"
51 fi
52
53 # intel i810 needs intel-agp module to work probably
54 case ${cfg_graphic_module} in
55 i810) add_module intel-agp ;;
56 intel) add_module intel-agp ;;
57 esac
58
59 for i in ${all_ids}
60 do
61 evaluate_table cfg_modules "where serial='${ALX_SERIAL}' and id='${i}'"
62 if [[ -n ${cfg_modules_module} ]]
63 then
64 add_module "${cfg_modules_module}" "${cfg_modules_arg}"
65 fi
66 done
67 }