/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (show annotations) (download)
Wed Jun 22 15:35:14 2005 UTC (9 years, 5 months ago) by wolf31o2
File size: 5282 byte(s)
Add ath/wlan to listed network devices.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20