/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (show annotations) (download)
Fri Jan 28 18:47:11 2005 UTC (9 years, 10 months ago) by wolf31o2
File size: 5160 byte(s)
Fixing bug in gpm checks.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20