/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29 - (show annotations) (download)
Sat Jan 29 21:54:59 2005 UTC (9 years, 6 months ago) by wolf31o2
File size: 5157 byte(s)
Fixed module loading for acpi and fixed syntax errors in gpm config.

1 #!/sbin/runscript
2 # Copyright 1999-2002 Gentoo Technologies, Inc.
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.17 2005/01/29 21:54:59 wolf31o2 Exp $
5
6 echo "0" > /proc/sys/kernel/printk
7 DHCP="yes"
8 DETECT="yes"
9 GPM="yes"
10 PCMCIA="no"
11 HOTPLUG="yes"
12 APM="no"
13 ACPI="no"
14 CMDLINE="`cat /proc/cmdline`"
15 for x in ${CMDLINE} ; do
16 if [ "${x}" = "nodetect" ]; then
17 DETECT="no"
18 GPM="no"
19 HOTPLUG="no"
20 APM="no"
21 ACPI="no"
22 fi
23
24 if [ "${x}" = "nodhcp" ]; then
25 DHCP="no"
26 fi
27
28 if [ "${x}" = "dopcmcia" ]; then
29 PCMCIA="yes"
30 fi
31
32 if [ "${x}" = "doapm" ]; then
33 APM="yes"
34 ACPI="no"
35 fi
36
37 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force" ]; then
38 APM="no"
39 ACPI="yes"
40 fi
41
42 if [ "${x}" = "nohotplug" ]; then
43 HOTPLUG="no"
44 fi
45 done
46
47 depend() {
48 need modules
49 }
50
51 start() {
52 if [ "${DETECT}" = "yes" ]; then
53 ebegin ${WARN}"Hardware detection started"
54 PC=`awk -F: '/^processor/{printf "Processor"$2" is"};/^model name/{printf $2};/^vendor_id/{printf vendor};/^cpu MHz/{printf " %dMHz",int($2)};/^cache size/{printf ","$2" Cache"};/^$/{print ""}' /proc/cpuinfo 2>/dev/null`
55 ebegin ${GOOD}"${PC}"
56 eend
57 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
58 eend
59 else
60 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
61 fi
62
63 if [ "${APM}" = "yes" ]; then
64 modprobe apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}"
65 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
66 else
67 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
68 eend
69 fi
70
71 if [ "${ACPI}" = "yes" ]; then
72 modprobe processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && modprobe thermal >/dev/null
73 modprobe fan >/dev/null 2>&1
74 modprobe button >/dev/null 2>&1
75 modprobe battery >/dev/null 2>&1
76 modprobe ac >/dev/null 2>&1
77 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
78 eend
79 fi
80
81 if [ "${PCMCIA}" = "yes" ]; then
82 ebegin ${HILITE} "PCMCIA enabled via cmdline"
83 /etc/init.d/pcmcia start
84 fi
85
86 if [ "${DHCP}" = "no" ]; then
87 sed -i -e '/^ifconfig_eth/ s//^#/' \
88 -e '/^iface_eth/ s//^#/' \
89 /etc/conf.d/net
90 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
91 fi
92
93 #Read in what hwsetup has found
94 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
95
96 # Mouse
97 if [ -n "${MOUSE_DEVICE}" ]; then
98 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
99 source /etc/sysconfig/mouse
100 if [ -x /usr/sbin/gpm ]; then
101 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
102 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
103 else
104 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
105 fi
106 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
107 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
108 else
109 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
110 fi
111 if [ "$GPM" = "yes" ]; then
112 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
113 fi
114 fi
115 eend
116 fi
117
118 if [ "${HOTPLUG}" = "yes" ]; then
119 #Check whether we should be using hotplug or coldplug
120 if [ -x /etc/init.d/coldplug ]; then
121 /etc/init.d/coldplug start
122 else
123 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start
124 fi
125 else
126 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}"
127 fi
128
129 if [ "${DETECT}" = "no" ]; then
130 DHCP="no"
131 fi
132
133 if [ "${DETECT}" = "yes" ]; then
134 NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
135 fi
136
137 if [ -n "${NETDEVICES}" ]; then
138 if [ "${DHCP}" = "yes" ]; then
139 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
140 dhcpcd -h `basename hostname` &
141 fi
142 eend
143
144 else
145 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
146 fi
147
148
149 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]; then
150 ebegin ${GOOD}"Soundcard:"
151 eend
152 [ -n "${SOUND_FULLNAME}" ]
153 ebegin " ${WARN}${SOUND_FULLNAME}"
154 [ -n "${SOUND_DRIVER}" ]
155 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
156 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
157 amixer scontrols > /etc/amixer
158 if [ -n "`grep Master /etc/amixer`" ]
159 then
160 amixer -q set Master 75% >/dev/null 2>&1
161 amixer -q set Master unmute >/dev/null 2>&1
162 fi
163 if [ -n "`grep PCM /etc/amixer`" ]
164 then
165 amixer -q set PCM 75% >/dev/null 2>&1
166 amixer -q set PCM unmute >/dev/null 2>&1
167 fi
168 if [ -n "`grep Mic /etc/amixer`" ]
169 then
170 amixer -q set Mic 75% >/dev/null 2>&1
171 amixer -q set Mic cap >/dev/null 2>&1
172 fi
173 if [ -n "`grep Wave /etc/amixer`" ]
174 then
175 amixer -q set Wave 75% >/dev/null 2>&1
176 amixer -q set Wave unmute >/dev/null 2>&1
177 fi
178 if [ -n "`grep Capture /etc/amixer`" ]
179 then
180 amixer -q set Capture 75% >/dev/null 2>&1
181 amixer -q set Capture cap >/dev/null 2>&1
182 amixer -q set Capture unmute >/dev/null 2>&1
183 fi
184 fi
185 fi
186
187
188 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then
189 ebegin ${GOOD}"VideoCard: ${WARN} ${XDESC}"
190 eend
191 fi
192
193 killall hwsetup 2>/dev/null
194 echo "6" > /proc/sys/kernel/printk
195
196 }
197
198 # vim: ts=4

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20