/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations) (download)
Sat Jan 29 23:30:27 2005 UTC (13 years, 5 months ago) by wolf31o2
File size: 5167 byte(s)
Added before * to depend in an effort to try to get it to run first in the runlevel.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20