/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (hide annotations) (download)
Fri Jul 1 14:46:54 2005 UTC (12 years, 6 months ago) by wolf31o2
File size: 5339 byte(s)
Added sourcing of /etc/sysconfig/gentoo, as I patched that in the latest hwsetup release.  Blame gustavoz, he needs more work.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20