/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

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

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

  ViewVC Help
Powered by ViewVC 1.1.20