/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24 - (show annotations) (download)
Mon Jan 24 21:00:21 2005 UTC (9 years, 5 months ago) by wolf31o2
File size: 4972 byte(s)
Added updated gpm support to autoconfig.  This resolves bug #78595.

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.13 2005/01/24 21:00:21 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" ]; 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 /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" ]; 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 /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 's/ifconfig_eth0=( "dhcp" )/#ifconfig_eth0=( "dhcp" )/' \
88 sed -i -e 's/ifconfig_eth1=( "dhcp" )/#ifconfig_eth1=( "dhcp" )/' \
89 sed -i -e 's/ifconfig_eth2=( "dhcp" )/#ifconfig_eth2=( "dhcp" )/' \
90 sed -i -e 's/ifconfig_eth3=( "dhcp" )/#ifconfig_eth3=( "dhcp" )/' \
91 /etc/conf.d/net
92 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
93 fi
94
95 #Read in what hwsetup has found
96 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
97
98 # Mouse
99 if [ -n "${MOUSE_DEVICE}" ]; then
100 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
101 source /etc/sysconfig/mouse
102 if [ -x /usr/sbin/gpm ]; then
103 if [ "grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm" ]; then
104 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
105 else
106 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
107 fi
108 if [ "grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm" ]; then
109 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
110 else
111 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
112 fi
113 if [ "$GPM" = "yes" ]; then
114 /etc/init.d/gpm start
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 /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 [ -n "`grep Master /etc/amixer`" ] && amixer -q set Master 75% \
160 && amixer -q set Master unmute
161 [ -n "`grep PCM /etc/amixer`" ] && amixer -q set PCM 75% \
162 && amixer -q set PCM unmute
163 [ -n "`grep Mic /etc/amixer`" ] && amixer -q set Mic 75% \
164 && amixer -q set Mic cap
165 [ -n "`grep Wave /etc/amixer`" ] && amixer -q set Wave 75% \
166 && amixer -q set Wave unmute
167 [ -n "`grep Capture /etc/amixer`" ] && amixer -q set Capture 75% \
168 && amixer -q set Capture cap && amixer -q set Capture unmute
169 fi
170 fi
171
172
173 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then
174 ebegin ${GOOD}"VideoCard: ${WARN} ${XDESC}"
175 eend
176 fi
177
178 killall hwsetup 2>/dev/null
179 echo "6" > /proc/sys/kernel/printk
180
181 }
182
183 # vim: ts=4

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20