/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

Revision 138 Revision 139
1#!/sbin/runscript 1#!/sbin/runscript
2
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.
2 5
3ACPI="no" 6ACPI="no"
4ALSA="yes" 7ALSA="yes"
5APM="no" 8APM="no"
6DETECT="yes" 9DETECT="yes"
32 DHCP="no" 35 DHCP="no"
33 ;; 36 ;;
34 nogpm) 37 nogpm)
35 GPM="no" 38 GPM="no"
36 ;; 39 ;;
37 dopcmcia) 40 nohotplug)
38 PCMCIA="yes" 41 HOTPLUG="no"
42 ;;
43 nonfs)
44 NFS="no"
45 ;;
46 nosound)
47 ALSA="no"
48 ;;
49 nox)
50 X11="no"
51 ;;
52 ide\=nodma)
53 IDEDMA="no"
39 ;; 54 ;;
40 doapm) 55 doapm)
41 ACPI="no" 56 ACPI="no"
42 APM="yes" 57 APM="yes"
43 ;; 58 ;;
44 acpi\=on|acpi\=force) 59 acpi\=on|acpi\=force)
45 ACPI="yes" 60 ACPI="yes"
46 APM="no" 61 APM="no"
47 ;; 62 ;;
48 ide\=nodma) 63 dopcmcia)
49 IDEDMA="no" 64 PCMCIA="yes"
50 ;;
51 nohotplug)
52 HOTPLUG="no"
53 ;;
54 nosound)
55 ALSA="no"
56 ;;
57 nonfs)
58 NFS="no"
59 ;; 65 ;;
60 dosshd) 66 dosshd)
61 SSHD="yes" 67 SSHD="yes"
62 ;;
63 nox)
64 X11="no"
65 ;; 68 ;;
66 esac 69 esac
67 done 70 done
68} 71}
69 72
106 echo ${svcs} 109 echo ${svcs}
107} 110}
108 111
109unpack_firmware() { 112unpack_firmware() {
110 # This unpacks any firmware tarballs. 113 # This unpacks any firmware tarballs.
111 # This has been moved here from coldplug, but might not be very effective
112 # since udev does coldplugging in 089 and higher.
113 if [ -e /lib/firmware.tar.bz2 ] 114 if [ -e /lib/firmware.tar.bz2 ]
114 then 115 then
115 ebegin "Unpacking hotplug firmware" 116 ebegin "Unpacking hotplug firmware"
116 tar xjf /lib/firmware.tar.bz2 -C /lib/firmware 117 tar xjf /lib/firmware.tar.bz2 -C /lib/firmware
117 eend 0 118 eend 0
122 local tmp 123 local tmp
123 124
124 if [ ! -z "${1}" -a ! -z "${2}" ] 125 if [ ! -z "${1}" -a ! -z "${2}" ]
125 then 126 then
126 tmp=$(grep "^$1[[:space:]]\+:" /proc/cpuinfo | head -n 1 | cut -d" " -f3-) 127 tmp=$(grep "^$1[[:space:]]\+:" /proc/cpuinfo | head -n 1 | cut -d" " -f3-)
127# tmp=$([[ $'\n'$(</proc/cpuinfo) =~ $'\n''$1[[:space:]]\+:' ]] | head -n 1 | cut -d" " -f3-)
128 eval "${2}='${tmp}'" 128 eval "${2}='${tmp}'"
129 fi 129 fi
130} 130}
131 131
132detect_mips() { 132detect_mips() {
234start() { 234start() {
235 echo "0" > /proc/sys/kernel/printk 235 echo "0" > /proc/sys/kernel/printk
236 get_config 236 get_config
237 237
238 # First off, we want hotplug/coldplug enabled, so let's re-enable it. 238 # First off, we want hotplug/coldplug enabled, so let's re-enable it.
239 # We do this even if we aren't startup up the hotplug/coldplug 239 # We do this even if we aren't starting up the hotplug/coldplug
240 # services for the installer. 240 # services for the installer.
241 sed -i 's/RC_COLDPLUG="no"/RC_COLDPLUG="yes"/' /etc/conf.d/rc 241 sed -i 's/RC_COLDPLUG="no"/RC_COLDPLUG="yes"/' /etc/conf.d/rc
242 # Now, we check if we're supposed to run a coldplug script. 242 # Now, we check if we're supposed to run a coldplug script.
243 if [ "${HOTPLUG}" = "yes" ] 243 if [ "${HOTPLUG}" = "yes" ]
244 then 244 then
260 260
261 if [ "${DETECT}" = "yes" ] 261 if [ "${DETECT}" = "yes" ]
262 then 262 then
263 ebegin "Hardware detection started" 263 ebegin "Hardware detection started"
264 local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)" 264 local numcpu="$(grep -c '^processor[[:space:]]\+:' /proc/cpuinfo)"
265# local numcpu=$([[ $'\n'$(</proc/cpuinfo) =~ $'\n''processor[[:space:]]\+:' ]] | wc -l)
266 local arch="$(uname -m)" 265 local arch="$(uname -m)"
267 266
268 case ${arch} in 267 case ${arch} in
269 mips*) 268 mips*)
270 detect_mips 269 detect_mips
352 -e '/^iface_eth.*dhcp.*/ s/^/#/' \ 351 -e '/^iface_eth.*dhcp.*/ s/^/#/' \
353 -e '/^config_eth.*dhcp.*/ s/^/#/' \ 352 -e '/^config_eth.*dhcp.*/ s/^/#/' \
354 /etc/conf.d/net 353 /etc/conf.d/net
355 for i in `seq 0 4` 354 for i in `seq 0 4`
356 do 355 do
357 echo "config_eth$i=( \"none\" )" >> /etc/conf.d/net 356 echo "config_eth${i}=( \"none\" )" >> /etc/conf.d/net
358 done 357 done
359 ewarn "Skipping DHCP broadcast ..." 358 ewarn "Skipping DHCP broadcast ..."
360 fi 359 fi
361 360
362 # Read in what hwsetup has found 361 # Read in what hwsetup has found
363 [ -f /etc/sysconfig/gentoo ] && . /etc/sysconfig/gentoo 362 [ -f /etc/sysconfig/gentoo ] && source /etc/sysconfig/gentoo
364 363
365 # Mouse 364 # Mouse
366 if [ -n "${MOUSE_DEVICE}" ] 365 if [ -n "${MOUSE_DEVICE}" ]
367 then 366 then
368 einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..." 367 einfo "Mouse is ${HILITE}${MOUSE_FULLNAME}${NORMAL} at ${HILITE}${MOUSE_DEVICE}${NORMAL} ..."
369 source /etc/sysconfig/mouse 368 source /etc/sysconfig/mouse
370 if [ -x /usr/sbin/gpm ] 369 if [ -x /usr/sbin/gpm ]
371 then 370 then
372 if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ] 371 if [ $(grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm) ]
373# if [ $([[ $'\n'$(</etc/conf.d/gpm) =~ $'\n''#MOUSE=${MOUSETYPE}' ]]) ]
374 then 372 then
375 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm 373 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
376 else 374 else
377 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm 375 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
378 fi 376 fi
379 377
380 if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ] 378 if [ $(grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm) ]
381# if [ $([[ $'\n'$(</etc/conf.d/gpm) =~ $'\n''#MOUSEDEV=${DEVICE}' ]]) ]
382 then 379 then
383 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm 380 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
384 else 381 else
385 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm 382 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
386 fi 383 fi
415 [ "${NFS}" = "yes" ] \ 412 [ "${NFS}" = "yes" ] \
416 && [ -x /etc/init.d/nfsmount ] && start_service nfsmount 413 && [ -x /etc/init.d/nfsmount ] && start_service nfsmount
417 if [ "${SSHD}" = "yes" ] 414 if [ "${SSHD}" = "yes" ]
418 then 415 then
419 # TODO: need to add a password check/warning here 416 # TODO: need to add a password check/warning here
417 ewarn "WARNING: You are starting sshd. You need to set a root password!"
420 [ -x /etc/init.d/sshd ] && start_service sshd 418 [ -x /etc/init.d/sshd ] && start_service sshd
421 fi 419 fi
422 else 420 else
423 ewarn "No Network device auto detected ..." 421 ewarn "No Network device auto detected ..."
424 fi 422 fi

Legend:
Removed from v.138  
changed lines
  Added in v.139

  ViewVC Help
Powered by ViewVC 1.1.20