/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

Revision 3 Revision 4
1#!/sbin/runscript 1#!/sbin/runscript
2# Copyright 1999-2002 Gentoo Technologies, Inc. 2# Copyright 1999-2002 Gentoo Technologies, Inc.
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.1 2004/03/21 19:46:44 zhen Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.2 2004/04/30 22:52:02 zhen Exp $
5
5echo "0" > /proc/sys/kernel/printk 6echo "0" > /proc/sys/kernel/printk
6DHCP="yes" 7DHCP="yes"
7DETECT="yes" 8DETECT="yes"
8PCMCIA="no" 9PCMCIA="no"
9HOTPLUG="yes" 10HOTPLUG="yes"
10APM="no" 11APM="no"
11ACPI="no" 12ACPI="no"
12CMDLINE="`cat /proc/cmdline`" 13CMDLINE="`cat /proc/cmdline`"
13for x in $CMDLINE 14for x in $CMDLINE
14do 15do
15 if [ "$x" = "nodetect" ] 16 if [ "$x" = "nodetect" ]
16 then 17 then
17 DETECT="no" 18 DETECT="no"
18 HOTPLUG="no" 19 HOTPLUG="no"
19 APM="no" 20 APM="no"
20 ACPI="no" 21 ACPI="no"
21 fi 22 fi
23
24 if [ "$x" = "nodhcp" ]
25 then
26 DHCP="no"
27 fi
28
29 if [ "$x" = "dopcmcia" ]
30 then
31 PCMCIA="yes"
32 fi
33
34 if [ "$x" = "doapm" ]
35 then
36 APM="yes"
37 fi
38
39 if [ "$x" = "acpi=on" ]
40 then
41 APM="no"
42 ACPI="yes"
43 fi
22done 44done
23for x in $CMDLINE
24do
25 if [ "$x" = "nodhcp" ]
26 then
27 DHCP="no"
28 fi
29done
30for x in $CMDLINE
31do
32 if [ "$x" = "dopcmcia" ]
33 then
34 PCMCIA="yes"
35 fi
36done
37for x in $CMDLINE
38do
39 if [ "$x" = "nohotplug" ]
40 then
41 HOTPLUG="no"
42 fi
43done
44for x in $CMDLINE
45do
46 if [ "$x" = "noapm" ]
47 then
48 APM="no"
49 fi
50done
51
52for x in $CMDLINE
53do
54 if [ "$x" = "acpi=on" ]
55 then
56 APM="no"
57 ACPI="yes"
58 fi
59done
60
61 45
62depend() { 46depend() {
63 need modules 47 need modules
64} 48}
65 49
66start() { 50start() {
67if [ "$DETECT" = "yes" ] 51if [ "$DETECT" = "yes" ]
68 then 52 then
69 ebegin $WARN"Hardware detection started" 53 ebegin $WARN"Hardware detection started"
70 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` 54 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`
71 ebegin $GOOD"$PC" 55 ebegin $GOOD"$PC"
72 eend 56 eend
73 hwsetup -p >/dev/null 57 hwsetup -p >/dev/null
74 eend 58 eend
75 else 59 else
76 ebegin $WARN"Hardware detection disabled via cmdline$NORMAL" 60 ebegin $WARN"Hardware detection disabled via cmdline$NORMAL"
77fi 61fi
78 62
79if [ "$APM" = "no" ] 63if [ "$APM" = "yes" ]
80 then 64 then
81 ebegin $GOOD"Not Loading APM Bios support.${NORMAL}" 65 insmod apm power_off=1 >/dev/null 2>&1 && ebegin $GOOD"APM BIOS found, power management functions enabled.$NORMAL"
66 /etc/init.d/apmd start
82 else 67 else
83 insmod apm power_off=1 >/dev/null 2>&1 && ebegin $GOOD"APM BIOS found, power management functions enabled.$NORMAL" 68 ebegin $GOOD"Not Loading APM Bios support.${NORMAL}"
84 /etc/init.d/apmd start
85 eend 69 eend
86fi 70fi
87 71
88
89if [ "$ACPI" = "yes" ] 72if [ "$ACPI" = "yes" ]
90 then 73then
91 insmod processor >/dev/null 2>&1 && ebegin $GOOD ACPI power management functions enabled.$NORMAL 74 insmod processor >/dev/null 2>&1 && ebegin $GOOD ACPI power management functions enabled.$NORMAL
92 insmod fan >/dev/null 75 insmod fan >/dev/null
93 insmod thermal >/dev/null 76 insmod thermal >/dev/null
94 insmod button >/dev/null 77 insmod button >/dev/null
95 insmod battery >/dev/null 78 insmod battery >/dev/null
96 insmod ac >/dev/null 79 insmod ac >/dev/null
97 /etc/init.d/acpid start 80 /etc/init.d/acpid start
145if [ -n "$NETDEVICES" ] 128if [ -n "$NETDEVICES" ]
146 then 129 then
147 ebegin $GOOD"Network device$HILITE$NETDEVICES$GOOD detected,$WARN DHCP broadcasting for IP.$NORMAL" 130 ebegin $GOOD"Network device$HILITE$NETDEVICES$GOOD detected,$WARN DHCP broadcasting for IP.$NORMAL"
148 if [ "${DHCP}" = "yes" ] 131 if [ "${DHCP}" = "yes" ]
149 then 132 then
150 dhcpcd 133 dhcpcd
151 fi 134 fi
152 eend 135 eend
136
153 else 137 else
154 ebegin $BAD"No Network device auto detected.$NORMAL" 138 ebegin $BAD"No Network device auto detected.$NORMAL"
155 139
156fi 140fi
157 141
158 142
159if [ -n "$SOUND_FULLNAME" -o -n "$SOUND_DRIVER" ] 143if [ -n "$SOUND_FULLNAME" -o -n "$SOUND_DRIVER" ]
176 then 160 then
177 ebegin $GOOD"VideoCard: $WARN ${XDESC}" 161 ebegin $GOOD"VideoCard: $WARN ${XDESC}"
178 eend 162 eend
179fi 163fi
180 164
181
182killall hwsetup 2>/dev/null 165killall hwsetup 2>/dev/null
183echo "6" > /proc/sys/kernel/printk 166echo "6" > /proc/sys/kernel/printk
167
184} 168}

Legend:
Removed from v.3  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.20