/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


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

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20