/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (hide annotations) (download)
Tue Mar 1 18:13:51 2005 UTC (13 years, 3 months ago) by wolf31o2
File size: 5252 byte(s)
Fixed net-setup and x-setup and also updated headers on all files.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20