Contents of /alx-src/branches/alxconf-060/functions/config_modules.sh
Parent Directory | Revision Log
Revision 332 -
(show annotations)
(download)
(as text)
Wed Sep 14 21:08:34 2005 UTC (19 years ago) by niro
Original Path: alx-src/trunk/alxconfig-ng/functions/config_modules.sh
File MIME type: application/x-sh
File size: 2265 byte(s)
Wed Sep 14 21:08:34 2005 UTC (19 years ago) by niro
Original Path: alx-src/trunk/alxconfig-ng/functions/config_modules.sh
File MIME type: application/x-sh
File size: 2265 byte(s)
- loading now lp, parport, parport_pc forcefully, some pcs with non fully acpi compilant bioses doesn't detect them right
1 | # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_modules.sh,v 1.4 2005-09-14 21:08:34 niro Exp $ |
2 | # configures printing on the host via mysql db settings |
3 | # Note must be the first configure script which will be startet |
4 | |
5 | kernel_major_version() |
6 | { |
7 | local KV |
8 | KV="$(uname -r | cut -d. -f1-2)" |
9 | echo "${KV}" |
10 | } |
11 | |
12 | get_modules_settings() |
13 | { |
14 | local i count mod_ids settings |
15 | |
16 | # first get all module names |
17 | mod_ids=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
18 | "select id from cfg_modules where serial='${ALX_SERIAL}'") |
19 | |
20 | # set counter equal to numbers of printers |
21 | declare -i count=0 |
22 | for i in ${mod_ids} |
23 | do |
24 | # now get the other settings und put them in arrays |
25 | ALX_MODULES[${count}]=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
26 | "select module from cfg_modules where id=${i};") |
27 | |
28 | (( count++ )) |
29 | done |
30 | |
31 | # get network module |
32 | ALX_NETWORK_MODULE=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
33 | "select module from cfg_network where serial=${ALX_SERIAL};") |
34 | |
35 | ## fixes needed to satisfy some deps |
36 | ALX_GFX_MODULE=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
37 | "select module from cfg_graphic where serial=${ALX_SERIAL};") |
38 | |
39 | # export all settings |
40 | export ALX_COUNT=${count} |
41 | export ALX_NETWORK_MODULE |
42 | export ALX_GFX_MODULE |
43 | export ALX_MODULES |
44 | } |
45 | |
46 | add_modules() |
47 | { |
48 | local modules="$@" |
49 | local modfile="/etc/modules.autoload.d/kernel-$(kernel_major_version)" |
50 | local mod |
51 | |
52 | for mod in ${modules} |
53 | do |
54 | [ -n "$(find /lib/modules/$(uname -r) -name ${mod}.[o,k]*)" ] && \ |
55 | echo "${mod}" >> ${modfile} |
56 | done |
57 | } |
58 | |
59 | config_modules() |
60 | { |
61 | local i |
62 | local modfile |
63 | |
64 | #first of all get the vars |
65 | get_modules_settings |
66 | |
67 | # location of the modules.autoload file |
68 | modfile="/etc/modules.autoload.d/kernel-$(kernel_major_version)" |
69 | |
70 | # needed for printing: |
71 | add_modules lp parport parport_pc |
72 | |
73 | [ -n "${ALX_NETWORK_MODULE}" ] && \ |
74 | echo "${ALX_NETWORK_MODULE}" >> ${modfile} |
75 | |
76 | # intel i810 needs intel-agp module to work probably |
77 | [[ ${ALX_GFX_MODULE} = i810 ]] && add_modules intel-agp |
78 | |
79 | for ((i=0; i <= ALX_COUNT; i++)) |
80 | do |
81 | [ -n "${ALX_MODULES[${i}]}" ] && \ |
82 | echo "${ALX_MODULES[${i}]}" >> ${modfile} |
83 | done |
84 | |
85 | unset ALX_COUNT |
86 | unset ALX_MODULES |
87 | unset ALX_NETWORK_MODULE |
88 | unset ALX_GFX_MODULE |
89 | } |