/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

Revision 68 Revision 69
1#!/sbin/runscript 1#!/sbin/runscript
2# Copyright 1999-2005 Gentoo Foundation 2# Copyright 1999-2005 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2 3# Distributed under the terms of the GNU General Public License v2
4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.34 2005/07/08 18:59:36 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.35 2005/07/08 22:05:24 wolf31o2 Exp $
5 5
6DHCP="yes" 6DHCP="yes"
7DETECT="yes" 7DETECT="yes"
8GPM="yes" 8GPM="yes"
9PCMCIA="no" 9PCMCIA="no"
12ACPI="no" 12ACPI="no"
13IDEDMA="yes" 13IDEDMA="yes"
14ALSA="yes" 14ALSA="yes"
15 15
16get_config() { 16get_config() {
17 echo "0" > /proc/sys/kernel/printk
18 CMDLINE="$(cat /proc/cmdline)" 17 CMDLINE="$(cat /proc/cmdline)"
19 18
20 for x in ${CMDLINE} ; do 19 for x in ${CMDLINE} ; do
21 if [ "${x}" = "nodetect" ] 20 if [ "${x}" = "nodetect" ]
22 then 21 then
76 need modules 75 need modules
77 before net 76 before net
78# provide gpm pcmcia apmd acpid coldplug hdparm alsasound 77# provide gpm pcmcia apmd acpid coldplug hdparm alsasound
79} 78}
80 79
80# Checks whether a service will be started by autoconfig.
81# Usage: check_svc var service [service_alternative]
82check_svc() {
83 if [ "$1" = "yes" ]; then
84 if [ -x "/etc/init.d/$2" ]; then
85 echo "$2"
86 elif [ -n "$3" -a -x "/etc/init.d/$3" ]; then
87 echo "$3"
88 fi
89 fi
90}
91
92# Prints an ordered list of services that will be started by autoconfig.
93list_services() {
94 get_config
95
96 local svcs="$(check_svc ${APM} apmd)"
97 svcs="${svcs} $(check_svc ${ACPI} acpid)"
98 svcs="${svcs} $(check_svc ${IDEDMA} hdparm)"
99 svcs="${svcs} $(check_svc ${PCMCIA} pcmcia)"
100 svcs="${svcs} $(check_svc ${GPM} gpm)"
101 svcs="${svcs} $(check_svc ${HOTPLUG} coldplug hotplug)"
102 svcs="${svcs} $(check_svc ${ALSA} alsasound)"
103
104 echo ${svcs}
105}
106
81start() { 107start() {
108 echo "0" > /proc/sys/kernel/printk
82 get_config 109 get_config
83 if [ "${DETECT}" = "yes" ] 110 if [ "${DETECT}" = "yes" ]
84 then 111 then
85 ebegin ${WARN}"Hardware detection started" 112 ebegin ${WARN}"Hardware detection started"
86 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) 113 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)
246 eend 273 eend
247 fi 274 fi
248 275
249 killall hwsetup 2>/dev/null 276 killall hwsetup 2>/dev/null
250 echo "6" > /proc/sys/kernel/printk 277 echo "6" > /proc/sys/kernel/printk
251
252} 278}
253 279
254# vim: ts=4 280# vim: ts=4

Legend:
Removed from v.68  
changed lines
  Added in v.69

  ViewVC Help
Powered by ViewVC 1.1.20