/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 35 - (show annotations) (download)
Thu Feb 3 20:34:35 2005 UTC (9 years, 2 months ago) by wolf31o2
File size: 5260 byte(s)
Removed before *, as it causes a warning from checkroot.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20