/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 47 Revision 141
1#!/sbin/runscript 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.23 2005/04/13 13:19:58 wolf31o2 Exp $
5 2
6echo "0" > /proc/sys/kernel/printk 3# This script is used by Gentoo release media to start certain services and to
4# ensure a sane setup for a CD-based boot.
5
6ACPI="yes"
7ALSA="yes"
8APM="no"
9DETECT="yes"
7DHCP="yes" 10DHCP="yes"
8DETECT="yes" 11DMRAID="yes"
12EVMS="no"
13FIREWIRE="yes"
9GPM="yes" 14GPM="yes"
10PCMCIA="no" 15HALD="yes"
11HOTPLUG="yes" 16HOTPLUG="yes"
17IDEDMA="yes"
12APM="no" 18LVM="no"
19MDADM="yes"
20NET="yes"
21NFS="yes"
22PASSWD="yes"
23PATA="yes"
24PCMCIA="yes"
25SATA="yes"
13ACPI="no" 26SCSI="no"
27SSHD="no"
28USB="yes"
29X11="yes"
30
31get_config() {
14CMDLINE="`cat /proc/cmdline`" 32 CMDLINE="$(cat /proc/cmdline)"
33
15for x in ${CMDLINE} ; do 34 for x in ${CMDLINE} ; do
16 if [ "${x}" = "nodetect" ]; then 35 case "${x}" in
36 # We put nodetect first, so we can override it with do* commands
37 nodetect)
38 ACPI="no"
39 ALSA="no"
40 APM="no"
17 DETECT="no" 41 DETECT="no"
42 DMRAID="no"
43 EVMS="no"
44 FIREWIRE="no"
18 GPM="no" 45 GPM="no"
46 HALD="no"
19 HOTPLUG="no" 47 HOTPLUG="no"
48 LVM="no"
49 MDADM="no"
50 NET="no"
51 NFS="no"
52 PCMCIA="no"
53 PATA="no"
54 SATA="no"
55 SCSI="no"
56 USB="no"
57 X11="no"
58 ;;
59 noapm)
20 APM="no" 60 APM="no"
21 ACPI="no" 61 ;;
22 fi 62 nodhcp)
23
24 if [ "${x}" = "nodhcp" ]; then
25 DHCP="no" 63 DHCP="no"
26 fi 64 ;;
27 65 nodmraid)
28 if [ "${x}" = "nogpm" ]; then 66 DMRAID="no"
67 ;;
68 noevms|noevms2)
69 EVMS="no"
70 ;;
71 nofirewire)
72 FIREWIRE="no"
73 ;;
74 nogpm)
29 GPM="no" 75 GPM="no"
30 fi 76 ;;
31 77 nohotplug)
32 if [ "${x}" = "dopcmcia" ]; then
33 PCMCIA="yes"
34 fi
35
36 if [ "${x}" = "doapm" ]; then
37 APM="yes"
38 ACPI="no"
39 fi
40
41 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force" ]; then
42 APM="no"
43 ACPI="yes"
44 fi
45
46 if [ "${x}" = "nohotplug" ]; then
47 HOTPLUG="no" 78 HOTPLUG="no"
48 fi 79 ;;
80 noload=*)
81 NOLOAD="$*"
82 ;;
83 nolvm|nolvm2)
84 LVM="no"
85 ;;
86 nomdadm)
87 MDADM="no"
88 ;;
89 nonet)
90 NET="no"
91 ;;
92 nonfs)
93 NFS="no"
94 ;;
95 nopata)
96 PATA="no"
97 ;;
98 nopcmcia)
99 PCMCIA="no"
100 ;;
101 nosata)
102 SATA="no"
103 ;;
104 noscsi)
105 SCSI="no"
106 ;;
107 nosshd)
108 SSHD="no"
109 ;;
110 nosound)
111 ALSA="no"
112 ;;
113 nousb)
114 USB="no"
115 nox)
116 X11="no"
117 ;;
118 ide\=nodma)
119 IDEDMA="no"
120 ;;
121 acpi\=on|acpi\=force)
122 ACPI="yes"
123 APM="no"
124 ;;
125 doapm)
126 ACPI="no"
127 APM="yes"
128 ;;
129 dodhcp)
130 DHCP="yes"
131 ;;
132 dodmraid)
133 DMRAID="yes"
134 ;;
135 doevms|doevms2)
136 EVMS="yes"
137 ;;
138 dofirewire)
139 FIREWIRE="yes"
140 ;;
141 dogpm)
142 GPM="yes"
143 ;;
144 dohotplug)
145 HOTPLUG="yes"
146 ;;
147 dolvm|dolvm2)
148 LVM="yes"
149 ;;
150 domdadm)
151 MDADM="yes"
152 ;;
153 donet)
154 NET="yes"
155 ;;
156 dopata)
157 PATA="yes"
158 ;;
159 dopcmcia)
160 PCMCIA="yes"
161 ;;
162 dosata)
163 SATA="yes"
164 ;;
165 doscsi)
166 SCSI="yes"
167 ;;
168 dosshd)
169 SSHD="yes"
170 ;;
171 dosound)
172 SOUND="yes"
173 ;;
174 dousb)
175 USE="yes"
176 ;;
177 dox)
178 X11="yes"
179 ;;
180 passwd=*)
181 PASSWD="no"
182 PASSWORD="$*"
183 ;;
184 esac
49done 185 done
186}
50 187
51depend() { 188depend() {
52 need modules 189 need modules
53 use alsasound 190 before net
54# provide gpm pcmcia apmd acpid coldplug 191}
192
193# Checks whether a service will be started by autoconfig.
194# Usage: check_svc var service [service_alternative]
195check_svc() {
196 if [ "${1}" = "yes" ]
197 then
198 if [ -x "/etc/init.d/${2}" ]
199 then
200 echo "${2}"
201 elif [ -n "${3}" -a -x "/etc/init.d/${3}" ]
202 then
203 echo "${3}"
204 fi
205 fi
206}
207
208# Prints an ordered list of services that will be started by autoconfig.
209list_services() {
210 get_config
211
212 local svcs="$(check_svc ${ACPI} acpid)"
213 svcs="${svcs} $(check_svc ${ALSA} alsasound)"
214 svcs="${svcs} $(check_svc ${APM} apmd)"
215 svcs="${svcs} $(check_svc ${GPM} gpm)"
216 svcs="${svcs} $(check_svc ${HALD} hald)"
217 svcs="${svcs} $(check_svc ${HOTPLUG} coldplug hotplug)"
218 svcs="${svcs} $(check_svc ${IDEDMA} hdparm)"
219 svcs="${svcs} $(check_svc ${NFS} nfsmount)"
220 svcs="${svcs} $(check_svc ${PASSWD} pwgen"
221 svcs="${svcs} $(check_svc ${PCMCIA} pcmcia)"
222 svcs="${svcs} $(check_svc ${SSH} sshd)"
223 svcs="${svcs} $(check_svc ${X11} mkxf86config x-setup)"
224
225 ### TODO: make this baselayout-2 compatible
226 ### TODO: make these checks accurate using service dependencies
227
228 echo ${svcs}
229}
230
231unpack_firmware() {
232 # This unpacks any firmware tarballs.
233 if [ -e /lib/firmware.tar.bz2 ]
234 then
235 ebegin "Unpacking hotplug firmware"
236 tar xjf /lib/firmware.tar.bz2 -C /lib/firmware
237 eend 0
238 fi
239}
240
241get_info() {
242 local tmp
243
244 if [ ! -z "${1}" -a ! -z "${2}" ]
245 then
246 tmp=$(grep "^$1[[:space:]]\+:" /proc/cpuinfo | head -n 1 | cut -d" " -f3-)
247 eval "${2}='${tmp}'"
248 fi
249}
250
251detect_mips() {
252 get_info "cpu model" cpuinfo
253 get_info "system type" machinfo
254 cpuinfo="${cpuinfo%% FPU*}"
255
256 case "${machinfo}" in
257 "SGI Indigo2")
258 case "${cpuinfo}" in
259 R4*)
260 machinfo="SGI Indigo2" # I2 R4x00
261 ;;
262 R8*)
263 machinfo="SGI Indigo2 Power" # I2 R8000
264 ;;
265 R10*)
266 machinfo="SGI Indigo2 Impact" # I2 R10000
267 ;;
268 esac
269 ;;
270 esac
271
272 PC="Detected an ${machinfo} w/ ${numcpu} ${cpuinfo} CPU(s)"
273}
274
275detect_x86_amd64_ia64() {
276 if [ "${1}" = "ia64" ]
277 then
278 get_info "family" cpuinfo
279 else
280 get_info "model name" cpuinfo
281 fi
282 get_info "cpu MHz" mhz
283 mhz="${mhz%%.*}MHz"
284
285 PC="Detected ${numcpu} ${cpuinfo} CPU(s) @ ${mhz}"
286}
287
288detect_alpha() {
289 get_info "platform string" machinfo
290 get_info "cpu" cpuinfo1
291 get_info "cpu model" cpuinfo2
292 get_info "cpus detected" numcpu
293
294 PC="Detected ${numcpu} ${cpuinfo1} ${cpuinfo2} CPU(s) in a ${machinfo} system"
295}
296
297detect_ppc() {
298 get_info "cpu" cpuinfo
299 get_info "clock" mhz
300 get_info "detected as" machinfo
301 machinfo="${machinfo##*\(}"
302 machinfo="${machinfo%%\)*}"
303
304 local machtype=""
305
306 case "${machinfo}" in
307 "CHRP Pegasos2")
308 machtype="Pegasos 2"
309 ;;
310 "CHRP IBM,9124-720")
311 machtype="IBM OP720"
312 ;;
313 "iBook 2 rev. 2")
314 machtype="Apple iBook G3"
315 ;;
316 "iMac G5"*)
317 machtype="Apple iMac G5"
318 ;;
319 "MPC8241")
320 machtype="Kurobox"
321 ;;
322 "PowerMac G5")
323 machtype="Apple PowerMac G5"
324 ;;
325 "PowerMac G5 Dual Core")
326 machtype="Apple PowerMac G5 Dual Core"
327 ;;
328 "PowerMac G4 AGP Graphics")
329 machtype="Apple PowerMac G4"
330 ;;
331 "PowerBook Titanium"|'PowerBook G4 15"')
332 machtype="Apple Powerbook G4"
333 ;;
334 "Unknown Intrepid-based")
335 machtype="Apple Mac-Mini"
336 ;;
337 *)
338 machtype="Unknown PPC System"
339 ;;
340 esac
341
342 PC="Detected a(n) ${machtype} w/ ${numcpu} ${cpuinfo} CPU(s)"
343}
344
345detect_sparc() {
346 get_info "cpu" cpuinfo
347 get_info "ncpus active" numcpu
348 get_info "ncpus probed" numprobed
349
350 PC="Detected ${numcpu} active ${cpuinfo} CPU(s) of ${numprobed} total"
55} 351}
56 352
57start() { 353start() {
354 echo "0" > /proc/sys/kernel/printk
355 get_config
356
357 # First off, we want hotplug/coldplug enabled, so let's re-enable it.
358 # We do this even if we aren't starting up the hotplug/coldplug
359 # services for the installer.
360 sed -i 's/RC_COLDPLUG="no"/RC_COLDPLUG="yes"/' /etc/conf.d/rc
361 # Now, we check if we're supposed to run a coldplug script.
362 if [ "${HOTPLUG}" = "yes" ]
363 then
364 # Check whether we should be using hotplug/coldplug or whether we should
365 # just let udev do it all.
366 if [ -x /etc/init.d/coldplug ]
367 then
368 start_service coldplug
369 elif [ -x /etc/init.d/hotplug ]
370 then
371 start_service hotplug
372 else
373 unpack_firmware
374 [ -x /sbin/udevtrigger ] && /sbin/udevtrigger
375 fi
376 else
377 ewarn "Hotplug/Coldplug disabled via cmdline ..."
378 fi
379
58 if [ "${DETECT}" = "yes" ]; then 380 if [ "${DETECT}" = "yes" ]
381 then
59 ebegin ${WARN}"Hardware detection started" 382 ebegin "Hardware detection started"
60 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` 383 local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)"
61 ebegin ${GOOD}"${PC}" 384 local arch="$(uname -m)"
62 eend 385
386 case ${arch} in
387 mips*)
388 detect_mips
389 ACPI="no"
390 APM="no"
391 IDEDMA="no"
392 ;;
393 i?86|x86_64)
394 detect_x86_amd64_ia64
395 ;;
396 alpha)
397 detect_alpha
398 ACPI="no"
399 APM="no"
400 ;;
401 sparc*)
402 detect_sparc
403 ACPI="no"
404 APM="no"
405 ;;
406 powerpc*)
407 detect_ppc
408 ACPI="no"
409 APM="no"
410 ;;
411 ia64)
412 detect_x86_amd64_ia64 "ia64"
413 APM="no"
414 ;;
415 *)
416 PC=
417 ;;
418 esac
419 [ -n "${PC}" ] && einfo "${PC}"
63 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null 420 [ -x /usr/sbin/hwsetup ] && hwsetup
64 eend 421 eend
65 else 422 else
66 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL" 423 ewarn "Hardware detection disabled via cmdline ..."
67 fi 424 fi
68 425
69 if [ "${APM}" = "yes" ]; then 426 if [ "${APM}" = "yes" ]
70 modprobe apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}" 427 then
71 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start 428 modprobe apm power_off=1 >/dev/null 2>&1 && \
429 einfo "APM BIOS found, power management functions enabled ..."
430 [ -x /etc/init.d/apmd ] && start_service apmd
72 else 431 else
73 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}" 432 einfo "Not Loading APM Bios support ..."
74 eend
75 fi 433 fi
76 434
77 if [ "${ACPI}" = "yes" ]; then 435 if [ "${ACPI}" = "yes" ]
78 modprobe processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && modprobe thermal >/dev/null 436 then
437 modprobe processor >/dev/null 2>&1 && \
438 ebegin "ACPI power management functions enabled" && \
439 modprobe thermal >/dev/null
79 modprobe fan >/dev/null 2>&1 440 modprobe fan >/dev/null 2>&1
80 modprobe button >/dev/null 2>&1 441 modprobe button >/dev/null 2>&1
81 modprobe battery >/dev/null 2>&1 442 modprobe battery >/dev/null 2>&1
82 modprobe ac >/dev/null 2>&1 443 modprobe ac >/dev/null 2>&1
83 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start 444 modprobe thermal >/dev/null 2>&1
445 modprobe video >/dev/null 2>&1
446 modprobe dock >/dev/null 2>&1
447 [ -x /etc/init.d/acpid ] && start_service acpid
84 eend 448 eend
449 else
450 einfo "Not Loading ACPI support ..."
85 fi 451 fi
86 452
453 if [ "${IDEDMA}" = "yes" ]
454 then
455 [ -x /etc/init.d/hdparm ] && start_service hdparm
456 else
457 ewarn "Disabling IDE DMA support ..."
458 fi
459
87 if [ "${PCMCIA}" = "yes" ]; then 460 if [ "${PCMCIA}" = "yes" ]
88 ebegin ${HILITE} "PCMCIA enabled via cmdline" 461 then
89 /etc/init.d/pcmcia start 462 [ -x /etc/init.d/pcmcia ] && start_service pcmcia
463 else
464 ewarn "PCMCIA disabled via cmdline ..."
90 fi 465 fi
91 466
92 if [ "${DHCP}" = "no" ]; then 467 if [ "${DHCP}" = "no" ]
468 then
93 sed -i -e '/^ifconfig_eth/ s//^#/' \ 469 sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
94 -e '/^iface_eth/ s//^#/' \ 470 -e '/^iface_eth.*dhcp.*/ s/^/#/' \
471 -e '/^config_eth.*dhcp.*/ s/^/#/' \
95 /etc/conf.d/net 472 /etc/conf.d/net
96 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline." 473 for i in `seq 0 4`
474 do
475 echo "config_eth${i}=( \"none\" )" >> /etc/conf.d/net
476 done
477 ewarn "Skipping DHCP broadcast ..."
97 fi 478 fi
98 479
99 #Read in what hwsetup has found 480 # Read in what hwsetup has found
100 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix 481 [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
101 482
102 # Mouse 483 # Mouse
103 if [ -n "${MOUSE_DEVICE}" ]; then 484 if [ -n "${MOUSE_DEVICE}" ]
485 then
104 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}" 486 einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
105 source /etc/sysconfig/mouse 487 source /etc/sysconfig/mouse
106 if [ -x /usr/sbin/gpm ]; then 488 if [ -x /usr/sbin/gpm ]
489 then
107 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then 490 if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]
491 then
108 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm 492 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
109 else 493 else
110 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm 494 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
111 fi 495 fi
496
112 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then 497 if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]
498 then
113 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm 499 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
114 else 500 else
115 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm 501 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
116 fi 502 fi
503
504 [ "${GPM}" = "yes" ] \
505 && [ -x /etc/init.d/gpm ] && start_service gpm
506 fi
507 fi
508
509 [ "${DETECT}" = "no" ] && DHCP="no"
510 [ "${DETECT}" = "yes" ] \
511 && NETDEVICES="$(awk -F: '/eth.:|tr.:|ath.:|wlan.:/{print $1}' /proc/net/dev 2>/dev/null)"
512
513 if [ -n "${NETDEVICES}" ]
514 then
515 for nics in ${NETDEVICES}
516 do
117 if [ "$GPM" = "yes" ]; then 517 if [ "${DHCP}" = "yes" ]
118 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start 518 then
519 einfo "Network device ${HILITE}${nics}${NORMAL} detected, DHCP broadcasting for IP ..."
520 if [ -f /var/run/dhcpcd-${nics}.pid ]
521 then
522 if [ -z "$(/sbin/ifconfig ${nics} | grep 'inet addr')" ]
523 then
524 kill $(cat /var/run/dhcpcd-${nics}.pid)
525 sleep 2
526 dhcpcd -n -h $(hostname) ${nics}
527 fi
528 fi
529 fi
530 done
531 [ "${NFS}" = "yes" ] \
532 && [ -x /etc/init.d/nfsmount ] && start_service nfsmount
533 if [ "${PASSWD}" = "no" ]
534 then
535 echo "root:${PASSWORD}" | chpasswd > /dev/null 2>&1
536 else
537 start_service pwgen
538 fi
539 if [ "${SSHD}" = "yes" ]
540 then
541 # If we have passwd= on the command line, we don't run pwgen and we
542 # set the root password to PASSWORD.
543 if [ "${PASSWD}" = "yes" ]
544 then
545 ewarn "WARNING: You are starting sshd with a scrambled root password!!!"
546 ewarn "WARNING: You need to set a root password to be able to login remotely."
547 fi
548 [ -x /etc/init.d/sshd ] && start_service sshd
549 fi
550 else
551 ewarn "No Network device auto detected ..."
552 fi
553
554 if [ "${ALSA}" = "yes" ]
555 then
556 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]
557 then
558 local sndmsg="Soundcard:\n"
559
560 [ -n "${SOUND_FULLNAME}" ] \
561 && sndmsg="${sndmsg} ${WARN}${SOUND_FULLNAME}\n"
562 [ -n "${SOUND_DRIVER}" ] \
563 && sndmsg="${sndmsg} driver = ${SOUND_DRIVER}\n"
564
565 einfo "${sndmsg}"
566
567 if [ -x /etc/init.d/alsasound ]
568 then
569 start_service alsasound
570 fi
571
572 if [ -e /proc/asound/cards ]
573 then
574 for i in $(cat /proc/asound/cards | awk '{print $1}' | grep ^[[:digit:]])
575 do
576 if [ -d /proc/asound/card$i ] && [ -x /usr/bin/amixer ]
577 then
578 amixer -c $i scontrols > /etc/amixer
579 [ -n "$(grep Master /etc/amixer)" ] \
580 && amixer -c $i -q set Master 95% unmute \
581 >/dev/null 2>&1
582 [ -n "$(grep PCM /etc/amixer)" ] \
583 && amixer -c $i -q set PCM 95% unmute \
584 >/dev/null 2>&1
585 [ -n "$(grep Mic /etc/amixer)" ] \
586 && amixer -c $i -q set Mic 95% mute cap \
587 >/dev/null 2>&1
588 [ -n "$(grep Wave /etc/amixer)" ] \
589 && amixer -c $i -q set Wave 95% unmute \
590 >/dev/null 2>&1
591 [ -n "$(grep Capture /etc/amixer)" ] \
592 && amixer -c $i -q set Capture 95% unmute cap \
593 >/dev/null 2>&1
594 fi
595 done
119 fi 596 fi
120 fi 597 fi
121 eend
122 fi
123
124 if [ "${HOTPLUG}" = "yes" ]; then
125 #Check whether we should be using hotplug or coldplug
126 if [ -x /etc/init.d/coldplug ]; then
127 /etc/init.d/coldplug start
128 else 598 else
129 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start 599 ewarn "Skipping ALSA detection as requested on command line ..."
600 fi
601
602 [ -n "${XDESC}" ] && einfo "VideoCard: ${HILITE}${XDESC}${NORMAL}"
603
604 if [ "${X11}" = "yes" ]
605 then
606 if [ -x /etc/init.d/mkxf86config ]
607 then
608 start_service mkxf86config
130 fi 609 fi
131 else 610 if [ -x /etc/init.d/x-setup ]
132 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}" 611 then
133 fi 612 start_service x-setup
134
135 if [ "${DETECT}" = "no" ]; then
136 DHCP="no"
137 fi
138
139 if [ "${DETECT}" = "yes" ]; then
140 NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
141 fi
142
143 if [ -n "${NETDEVICES}" ]; then
144 if [ "${DHCP}" = "yes" ]; then
145 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
146 dhcpcd -h $(hostname) &
147 fi 613 fi
148 eend
149
150 else 614 else
151 ebegin ${BAD}"No Network device auto detected.${NORMAL}" 615 touch /etc/init.d/.noxdm
152 fi
153
154
155 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]; then
156 ebegin ${GOOD}"Soundcard:"
157 eend
158 [ -n "${SOUND_FULLNAME}" ]
159 ebegin " ${WARN}${SOUND_FULLNAME}"
160 [ -n "${SOUND_DRIVER}" ]
161 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
162 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
163 amixer scontrols > /etc/amixer
164 if [ -n "`grep Master /etc/amixer`" ]
165 then
166 amixer -q set Master 95% unmute >/dev/null 2>&1
167 fi
168 if [ -n "`grep PCM /etc/amixer`" ]
169 then
170 amixer -q set PCM 95% unmute >/dev/null 2>&1
171 fi
172 if [ -n "`grep Mic /etc/amixer`" ]
173 then
174 amixer -q set Mic 95% unmute cap >/dev/null 2>&1
175 fi
176 if [ -n "`grep Wave /etc/amixer`" ]
177 then
178 amixer -q set Wave 95% unmute >/dev/null 2>&1
179 fi
180 if [ -n "`grep Capture /etc/amixer`" ]
181 then
182 amixer -q set Capture 95% unmute cap >/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 616 fi
192 617
193 killall hwsetup 2>/dev/null 618 killall hwsetup 2>/dev/null
194 echo "6" > /proc/sys/kernel/printk 619 echo "6" > /proc/sys/kernel/printk
195
196} 620}
197 621
198# vim: ts=4 622# vim: ts=4

Legend:
Removed from v.47  
changed lines
  Added in v.141

  ViewVC Help
Powered by ViewVC 1.1.20