/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

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

Legend:
Removed from v.49  
changed lines
  Added in v.145

  ViewVC Help
Powered by ViewVC 1.1.20