/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Sun Jan 30 20:53:29 2005 UTC (9 years, 7 months ago) by wolf31o2
File size: 5214 byte(s)
Added nogpm call.

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.19 2005/01/30 20:53:29 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 before *
54 }
55
56 start() {
57 if [ "${DETECT}" = "yes" ]; then
58 ebegin ${WARN}"Hardware detection started"
59 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`
60 ebegin ${GOOD}"${PC}"
61 eend
62 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
63 eend
64 else
65 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
66 fi
67
68 if [ "${APM}" = "yes" ]; then
69 modprobe apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}"
70 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
71 else
72 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
73 eend
74 fi
75
76 if [ "${ACPI}" = "yes" ]; then
77 modprobe processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && modprobe thermal >/dev/null
78 modprobe fan >/dev/null 2>&1
79 modprobe button >/dev/null 2>&1
80 modprobe battery >/dev/null 2>&1
81 modprobe ac >/dev/null 2>&1
82 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
83 eend
84 fi
85
86 if [ "${PCMCIA}" = "yes" ]; then
87 ebegin ${HILITE} "PCMCIA enabled via cmdline"
88 /etc/init.d/pcmcia start
89 fi
90
91 if [ "${DHCP}" = "no" ]; then
92 sed -i -e '/^ifconfig_eth/ s//^#/' \
93 -e '/^iface_eth/ s//^#/' \
94 /etc/conf.d/net
95 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
96 fi
97
98 #Read in what hwsetup has found
99 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
100
101 # Mouse
102 if [ -n "${MOUSE_DEVICE}" ]; then
103 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
104 source /etc/sysconfig/mouse
105 if [ -x /usr/sbin/gpm ]; then
106 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
107 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
108 else
109 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
110 fi
111 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
112 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
113 else
114 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
115 fi
116 if [ "$GPM" = "yes" ]; then
117 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
118 fi
119 fi
120 eend
121 fi
122
123 if [ "${HOTPLUG}" = "yes" ]; then
124 #Check whether we should be using hotplug or coldplug
125 if [ -x /etc/init.d/coldplug ]; then
126 /etc/init.d/coldplug start
127 else
128 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start
129 fi
130 else
131 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}"
132 fi
133
134 if [ "${DETECT}" = "no" ]; then
135 DHCP="no"
136 fi
137
138 if [ "${DETECT}" = "yes" ]; then
139 NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
140 fi
141
142 if [ -n "${NETDEVICES}" ]; then
143 if [ "${DHCP}" = "yes" ]; then
144 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
145 dhcpcd -h `basename hostname` &
146 fi
147 eend
148
149 else
150 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
151 fi
152
153
154 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]; then
155 ebegin ${GOOD}"Soundcard:"
156 eend
157 [ -n "${SOUND_FULLNAME}" ]
158 ebegin " ${WARN}${SOUND_FULLNAME}"
159 [ -n "${SOUND_DRIVER}" ]
160 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
161 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
162 amixer scontrols > /etc/amixer
163 if [ -n "`grep Master /etc/amixer`" ]
164 then
165 amixer -q set Master 75% >/dev/null 2>&1
166 amixer -q set Master unmute >/dev/null 2>&1
167 fi
168 if [ -n "`grep PCM /etc/amixer`" ]
169 then
170 amixer -q set PCM 75% >/dev/null 2>&1
171 amixer -q set PCM unmute >/dev/null 2>&1
172 fi
173 if [ -n "`grep Mic /etc/amixer`" ]
174 then
175 amixer -q set Mic 75% >/dev/null 2>&1
176 amixer -q set Mic cap >/dev/null 2>&1
177 fi
178 if [ -n "`grep Wave /etc/amixer`" ]
179 then
180 amixer -q set Wave 75% >/dev/null 2>&1
181 amixer -q set Wave unmute >/dev/null 2>&1
182 fi
183 if [ -n "`grep Capture /etc/amixer`" ]
184 then
185 amixer -q set Capture 75% >/dev/null 2>&1
186 amixer -q set Capture cap >/dev/null 2>&1
187 amixer -q set Capture unmute >/dev/null 2>&1
188 fi
189 fi
190 fi
191
192
193 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then
194 ebegin ${GOOD}"VideoCard: ${WARN} ${XDESC}"
195 eend
196 fi
197
198 killall hwsetup 2>/dev/null
199 echo "6" > /proc/sys/kernel/printk
200
201 }
202
203 # vim: ts=4

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20