/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


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

1 zhen 2 #!/sbin/runscript
2     # Copyright 1999-2002 Gentoo Technologies, Inc.
3     # Distributed under the terms of the GNU General Public License v2
4 wolf31o2 27 # $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.16 2005/01/28 18:47:11 wolf31o2 Exp $
5 zhen 4
6 zhen 2 echo "0" > /proc/sys/kernel/printk
7     DHCP="yes"
8     DETECT="yes"
9 wolf31o2 24 GPM="yes"
10 zhen 2 PCMCIA="no"
11     HOTPLUG="yes"
12     APM="no"
13     ACPI="no"
14     CMDLINE="`cat /proc/cmdline`"
15 wolf31o2 18 for x in ${CMDLINE} ; do
16     if [ "${x}" = "nodetect" ]; then
17 zhen 4 DETECT="no"
18 wolf31o2 24 GPM="no"
19 zhen 2 HOTPLUG="no"
20     APM="no"
21     ACPI="no"
22 zhen 4 fi
23 zhen 2
24 wolf31o2 18 if [ "${x}" = "nodhcp" ]; then
25 zhen 4 DHCP="no"
26     fi
27    
28 wolf31o2 18 if [ "${x}" = "dopcmcia" ]; then
29 zhen 4 PCMCIA="yes"
30     fi
31    
32 wolf31o2 18 if [ "${x}" = "doapm" ]; then
33 zhen 4 APM="yes"
34 wolf31o2 10 ACPI="no"
35 zhen 4 fi
36    
37 wolf31o2 26 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force"]; then
38 zhen 4 APM="no"
39 zhen 2 ACPI="yes"
40 zhen 4 fi
41 wolf31o2 10
42 wolf31o2 18 if [ "${x}" = "nohotplug" ]; then
43 wolf31o2 10 HOTPLUG="no"
44     fi
45 zhen 2 done
46    
47     depend() {
48     need modules
49     }
50    
51     start() {
52 wolf31o2 18 if [ "${DETECT}" = "yes" ]; then
53     ebegin ${WARN}"Hardware detection started"
54 wolf31o2 20 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 wolf31o2 18 ebegin ${GOOD}"${PC}"
56 zhen 2 eend
57 wolf31o2 14 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
58 zhen 2 eend
59 wolf31o2 6 else
60 wolf31o2 18 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
61 wolf31o2 6 fi
62 zhen 2
63 wolf31o2 18 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 wolf31o2 26 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
66 zhen 2 else
67 wolf31o2 18 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
68 wolf31o2 6 eend
69     fi
70 zhen 2
71 wolf31o2 26 if [ "${ACPI}" = "yes" -o "${ACPI}" = "force" ]; then
72 wolf31o2 18 insmod processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && insmod thermal >/dev/null
73 wolf31o2 19 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 wolf31o2 26 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
78 wolf31o2 6 eend
79     fi
80 zhen 2
81 wolf31o2 18 if [ "${PCMCIA}" = "yes" ]; then
82     ebegin ${HILITE} "PCMCIA enabled via cmdline"
83 wolf31o2 6 /etc/init.d/pcmcia start
84     fi
85 zhen 2
86 wolf31o2 18 if [ "${DHCP}" = "no" ]; then
87 wolf31o2 25 sed -i -e '/^ifconfig_eth/ s//^#/' \
88     -e '/^iface_eth/ s//^#/' \
89     /etc/conf.d/net
90 wolf31o2 18 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
91 wolf31o2 6 fi
92 zhen 2
93 wolf31o2 6 #Read in what hwsetup has found
94     [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
95 zhen 2
96 wolf31o2 6 # Mouse
97 wolf31o2 18 if [ -n "${MOUSE_DEVICE}" ]; then
98     ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
99 wolf31o2 6 source /etc/sysconfig/mouse
100 wolf31o2 24 if [ -x /usr/sbin/gpm ]; then
101 wolf31o2 27 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
102 wolf31o2 24 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
103     else
104     echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
105     fi
106 wolf31o2 27 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
107 wolf31o2 24 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 wolf31o2 26 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
113 wolf31o2 24 fi
114 wolf31o2 6 eend
115     fi
116 zhen 2
117 wolf31o2 18 if [ "${HOTPLUG}" = "yes" ]; then
118 wolf31o2 17 #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 wolf31o2 26 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start
123 wolf31o2 17 fi
124 zhen 2 else
125 wolf31o2 18 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}"
126 wolf31o2 6 fi
127 zhen 2
128 wolf31o2 18 if [ "${DETECT}" = "no" ]; then
129 wolf31o2 6 DHCP="no"
130     fi
131 zhen 2
132 wolf31o2 18 if [ "${DETECT}" = "yes" ]; then
133 wolf31o2 20 NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
134 wolf31o2 6 fi
135 zhen 2
136 wolf31o2 18 if [ -n "${NETDEVICES}" ]; then
137 wolf31o2 6 if [ "${DHCP}" = "yes" ]; then
138 wolf31o2 18 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
139 wolf31o2 21 dhcpcd -h `basename hostname` &
140 wolf31o2 6 fi
141     eend
142 zhen 2
143     else
144 wolf31o2 18 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
145 wolf31o2 6 fi
146 zhen 2
147    
148 wolf31o2 18 if [ -n "${SOUND_FULLNAME}" -o -n "${SOUND_DRIVER}" ]; then
149     ebegin ${GOOD}"Soundcard:"
150 wolf31o2 6 eend
151 wolf31o2 18 [ -n "${SOUND_FULLNAME}" ]
152     ebegin " ${WARN}${SOUND_FULLNAME}"
153     [ -n "${SOUND_DRIVER}" ]
154     ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
155 wolf31o2 15 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
156     amixer scontrols > /etc/amixer
157 wolf31o2 26 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 wolf31o2 15 fi
184 wolf31o2 6 fi
185 zhen 2
186    
187 wolf31o2 18 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then
188     ebegin ${GOOD}"VideoCard: ${WARN} ${XDESC}"
189 zhen 2 eend
190 wolf31o2 6 fi
191 zhen 2
192 wolf31o2 6 killall hwsetup 2>/dev/null
193     echo "6" > /proc/sys/kernel/printk
194 zhen 4
195 zhen 2 }
196 wolf31o2 6
197     # vim: ts=4

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20