Contents of /alx-src/tags/alxconf-0_6_0-rc12/functions/config_modules.sh
Parent Directory | Revision Log
Revision 322 -
(show annotations)
(download)
(as text)
Thu Sep 1 23:58:43 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: 2087 byte(s)
Thu Sep 1 23:58:43 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: 2087 byte(s)
typo
1 | # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_modules.sh,v 1.3 2005-09-01 23:58:43 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 | config_modules() |
47 | { |
48 | local i |
49 | local modfile |
50 | |
51 | #first of all get the vars |
52 | get_modules_settings |
53 | |
54 | # location of the modules.autoload file |
55 | modfile="/etc/modules.autoload.d/kernel-$(kernel_major_version)" |
56 | |
57 | # write default settings: |
58 | echo "lp" > ${modfile} |
59 | [ -n "${ALX_NETWORK_MODULE}" ] && \ |
60 | echo "${ALX_NETWORK_MODULE}" >> ${modfile} |
61 | |
62 | # intel i810 needs intel-agp module to work probably |
63 | [[ ${ALX_GFX_MODULE} = i810 ]] && \ |
64 | [ -f /lib/modules/$(uname -r)/kernel/drivers/char/agp/intel-agp.ko ] && \ |
65 | echo "intel-agp" >> ${modfile} |
66 | |
67 | for ((i=0; i <= ALX_COUNT; i++)) |
68 | do |
69 | [ -n "${ALX_MODULES[${i}]}" ] && \ |
70 | echo "${ALX_MODULES[${i}]}" >> ${modfile} |
71 | done |
72 | |
73 | unset ALX_COUNT |
74 | unset ALX_MODULES |
75 | unset ALX_NETWORK_MODULE |
76 | unset ALX_GFX_MODULE |
77 | } |