/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 50 - (hide annotations) (download)
Mon May 16 18:21:48 2005 UTC (12 years, 11 months ago) by wolf31o2
File size: 5208 byte(s)
Added before net to depend.

1 zhen 2 #!/sbin/runscript
2 wolf31o2 44 # Copyright 1999-2005 Gentoo Foundation
3 zhen 2 # Distributed under the terms of the GNU General Public License v2
4 wolf31o2 50 # $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.26 2005/05/16 18:21:48 wolf31o2 Exp $
5 zhen 4
6 zhen 2 echo "0" > /proc/sys/kernel/printk
7     DHCP="yes"
8     DETECT="yes"
9 wolf31o2 24 GPM="yes"
10 zhen 2 PCMCIA="no"
11     HOTPLUG="yes"
12     APM="no"
13     ACPI="no"
14 wolf31o2 49 IDEDMA="yes"
15 zhen 2 CMDLINE="`cat /proc/cmdline`"
16 wolf31o2 18 for x in ${CMDLINE} ; do
17     if [ "${x}" = "nodetect" ]; then
18 zhen 4 DETECT="no"
19 wolf31o2 24 GPM="no"
20 zhen 2 HOTPLUG="no"
21     APM="no"
22     ACPI="no"
23 zhen 4 fi
24 zhen 2
25 wolf31o2 18 if [ "${x}" = "nodhcp" ]; then
26 zhen 4 DHCP="no"
27     fi
28    
29 wolf31o2 31 if [ "${x}" = "nogpm" ]; then
30     GPM="no"
31     fi
32    
33 wolf31o2 18 if [ "${x}" = "dopcmcia" ]; then
34 zhen 4 PCMCIA="yes"
35     fi
36    
37 wolf31o2 18 if [ "${x}" = "doapm" ]; then
38 zhen 4 APM="yes"
39 wolf31o2 10 ACPI="no"
40 zhen 4 fi
41    
42 wolf31o2 29 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force" ]; then
43 zhen 4 APM="no"
44 zhen 2 ACPI="yes"
45 zhen 4 fi
46 wolf31o2 10
47 wolf31o2 49 if [ "${x}" = "ide=nodma" ]; then
48     IDEDMA="no"
49     fi
50    
51 wolf31o2 18 if [ "${x}" = "nohotplug" ]; then
52 wolf31o2 10 HOTPLUG="no"
53     fi
54 zhen 2 done
55    
56     depend() {
57     need modules
58 wolf31o2 35 use alsasound
59 wolf31o2 50 before net
60     # provide gpm pcmcia apmd acpid coldplug hdparm
61 zhen 2 }
62    
63     start() {
64 wolf31o2 18 if [ "${DETECT}" = "yes" ]; then
65     ebegin ${WARN}"Hardware detection started"
66 wolf31o2 20 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`
67 wolf31o2 18 ebegin ${GOOD}"${PC}"
68 zhen 2 eend
69 wolf31o2 14 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
70 zhen 2 eend
71 wolf31o2 6 else
72 wolf31o2 18 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
73 wolf31o2 6 fi
74 zhen 2
75 wolf31o2 18 if [ "${APM}" = "yes" ]; then
76 wolf31o2 29 modprobe apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}"
77 wolf31o2 26 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
78 zhen 2 else
79 wolf31o2 18 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
80 wolf31o2 6 eend
81     fi
82 zhen 2
83 wolf31o2 29 if [ "${ACPI}" = "yes" ]; then
84     modprobe processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && modprobe thermal >/dev/null
85     modprobe fan >/dev/null 2>&1
86     modprobe button >/dev/null 2>&1
87     modprobe battery >/dev/null 2>&1
88     modprobe ac >/dev/null 2>&1
89 wolf31o2 26 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
90 wolf31o2 6 eend
91     fi
92 zhen 2
93 wolf31o2 49 if [ "${IDEDMA}" = "yes" ]; then
94     [ -x /etc/init.d/hdparm ] && /etc/init.d/hdparm start
95     fi
96    
97 wolf31o2 18 if [ "${PCMCIA}" = "yes" ]; then
98     ebegin ${HILITE} "PCMCIA enabled via cmdline"
99 wolf31o2 6 /etc/init.d/pcmcia start
100     fi
101 zhen 2
102 wolf31o2 18 if [ "${DHCP}" = "no" ]; then
103 wolf31o2 48 sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
104     -e '/^iface_eth.*dhcp.*/ s/^/#/' \
105 wolf31o2 25 /etc/conf.d/net
106 wolf31o2 18 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
107 wolf31o2 6 fi
108 zhen 2
109 wolf31o2 6 #Read in what hwsetup has found
110     [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
111 zhen 2
112 wolf31o2 6 # Mouse
113 wolf31o2 18 if [ -n "${MOUSE_DEVICE}" ]; then
114     ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
115 wolf31o2 6 source /etc/sysconfig/mouse
116 wolf31o2 24 if [ -x /usr/sbin/gpm ]; then
117 wolf31o2 27 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
118 wolf31o2 24 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
119     else
120     echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
121     fi
122 wolf31o2 27 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
123 wolf31o2 24 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
124     else
125     echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
126     fi
127     if [ "$GPM" = "yes" ]; then
128 wolf31o2 26 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
129 wolf31o2 24 fi
130 wolf31o2 29 fi
131 wolf31o2 6 eend
132     fi
133 zhen 2
134 wolf31o2 18 if [ "${HOTPLUG}" = "yes" ]; then
135 wolf31o2 17 #Check whether we should be using hotplug or coldplug
136     if [ -x /etc/init.d/coldplug ]; then
137     /etc/init.d/coldplug start
138     else
139 wolf31o2 26 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start
140 wolf31o2 17 fi
141 zhen 2 else
142 wolf31o2 18 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}"
143 wolf31o2 6 fi
144 zhen 2
145 wolf31o2 18 if [ "${DETECT}" = "no" ]; then
146 wolf31o2 6 DHCP="no"
147     fi
148 zhen 2
149 wolf31o2 18 if [ "${DETECT}" = "yes" ]; then
150 wolf31o2 20 NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
151 wolf31o2 6 fi
152 zhen 2
153 wolf31o2 18 if [ -n "${NETDEVICES}" ]; then
154 wolf31o2 6 if [ "${DHCP}" = "yes" ]; then
155 wolf31o2 18 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
156 wolf31o2 47 dhcpcd -h $(hostname) &
157 wolf31o2 6 fi
158     eend
159 zhen 2
160     else
161 wolf31o2 18 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
162 wolf31o2 6 fi
163 zhen 2
164    
165 wolf31o2 18 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]; then
166     ebegin ${GOOD}"Soundcard:"
167 wolf31o2 6 eend
168 wolf31o2 18 [ -n "${SOUND_FULLNAME}" ]
169     ebegin " ${WARN}${SOUND_FULLNAME}"
170     [ -n "${SOUND_DRIVER}" ]
171     ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
172 wolf31o2 15 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
173     amixer scontrols > /etc/amixer
174 wolf31o2 26 if [ -n "`grep Master /etc/amixer`" ]
175     then
176 wolf31o2 46 amixer -q set Master 95% unmute >/dev/null 2>&1
177 wolf31o2 26 fi
178     if [ -n "`grep PCM /etc/amixer`" ]
179     then
180 wolf31o2 46 amixer -q set PCM 95% unmute >/dev/null 2>&1
181 wolf31o2 26 fi
182     if [ -n "`grep Mic /etc/amixer`" ]
183     then
184 wolf31o2 46 amixer -q set Mic 95% unmute cap >/dev/null 2>&1
185 wolf31o2 26 fi
186     if [ -n "`grep Wave /etc/amixer`" ]
187     then
188 wolf31o2 46 amixer -q set Wave 95% unmute >/dev/null 2>&1
189 wolf31o2 26 fi
190     if [ -n "`grep Capture /etc/amixer`" ]
191     then
192 wolf31o2 46 amixer -q set Capture 95% unmute cap >/dev/null 2>&1
193 wolf31o2 26 fi
194 wolf31o2 15 fi
195 wolf31o2 6 fi
196 zhen 2
197    
198 wolf31o2 18 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then
199     ebegin ${GOOD}"VideoCard: ${WARN} ${XDESC}"
200 zhen 2 eend
201 wolf31o2 6 fi
202 zhen 2
203 wolf31o2 6 killall hwsetup 2>/dev/null
204     echo "6" > /proc/sys/kernel/printk
205 zhen 4
206 zhen 2 }
207 wolf31o2 6
208     # vim: ts=4

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20