/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide annotations) (download)
Thu Oct 21 01:13:34 2004 UTC (13 years, 8 months ago) by wolf31o2
File size: 3997 byte(s)
Only run hwsetup when it exists.

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 12 # $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.5 2004/10/21 01:13:34 wolf31o2 Exp $
5 zhen 4
6 zhen 2 echo "0" > /proc/sys/kernel/printk
7     DHCP="yes"
8     DETECT="yes"
9     PCMCIA="no"
10     HOTPLUG="yes"
11     APM="no"
12     ACPI="no"
13     CMDLINE="`cat /proc/cmdline`"
14 wolf31o2 6 for x in $CMDLINE ; do
15     if [ "$x" = "nodetect" ]; then
16 zhen 4 DETECT="no"
17 zhen 2 HOTPLUG="no"
18     APM="no"
19     ACPI="no"
20 zhen 4 fi
21 zhen 2
22 wolf31o2 6 if [ "$x" = "nodhcp" ]; then
23 zhen 4 DHCP="no"
24     fi
25    
26 wolf31o2 6 if [ "$x" = "dopcmcia" ]; then
27 zhen 4 PCMCIA="yes"
28     fi
29    
30 wolf31o2 6 if [ "$x" = "doapm" ]; then
31 zhen 4 APM="yes"
32 wolf31o2 10 ACPI="no"
33 zhen 4 fi
34    
35 wolf31o2 6 if [ "$x" = "acpi=on" ]; then
36 zhen 4 APM="no"
37 zhen 2 ACPI="yes"
38 zhen 4 fi
39 wolf31o2 10
40     if [ "$x" = "nohotplug" ]; then
41     HOTPLUG="no"
42     fi
43 zhen 2 done
44    
45     depend() {
46     need modules
47     }
48    
49     start() {
50 wolf31o2 6 if [ "$DETECT" = "yes" ]; then
51 zhen 2 ebegin $WARN"Hardware detection started"
52 zhen 4 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`
53 zhen 2 ebegin $GOOD"$PC"
54     eend
55 wolf31o2 12 [ -x /usr/bin/hwsetup ] && hwsetup -p >/dev/null
56 zhen 2 eend
57 wolf31o2 6 else
58 zhen 2 ebegin $WARN"Hardware detection disabled via cmdline$NORMAL"
59 wolf31o2 6 fi
60 zhen 2
61 wolf31o2 6 if [ "$APM" = "yes" ]; then
62 zhen 4 insmod apm power_off=1 >/dev/null 2>&1 && ebegin $GOOD"APM BIOS found, power management functions enabled.$NORMAL"
63     /etc/init.d/apmd start
64 zhen 2 else
65 zhen 4 ebegin $GOOD"Not Loading APM Bios support.${NORMAL}"
66 wolf31o2 6 eend
67     fi
68 zhen 2
69 wolf31o2 6 if [ "$ACPI" = "yes" ]; then
70     insmod processor >/dev/null 2>&1 && ebegin $GOOD ACPI power management functions enabled.$NORMAL
71     insmod fan >/dev/null
72     insmod thermal >/dev/null
73     insmod button >/dev/null
74     insmod battery >/dev/null
75     insmod ac >/dev/null
76     /etc/init.d/acpid start
77     eend
78     fi
79 zhen 2
80 wolf31o2 6 if [ "$PCMCIA" = "yes" ]; then
81     ebegin $HILITE "PCMCIA enabled via cmdline"
82     /etc/init.d/pcmcia start
83     fi
84 zhen 2
85 wolf31o2 6 if [ "$DHCP" = "no" ]; then
86 wolf31o2 10 sed -i 's/iface_eth0="dhcp"/#iface_eth0="dhcp"/' /etc/conf.d/net
87 wolf31o2 6 ebegin $BAD"Skipping DHCP broadcast detection as requested on boot commandline."
88     fi
89 zhen 2
90 wolf31o2 6 #Read in what hwsetup has found
91     [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
92 zhen 2
93 wolf31o2 6 # Mouse
94     if [ -n "$MOUSE_DEVICE" ]; then
95     ebegin $GOOD"Mouse is $HILITE$MOUSE_FULLNAME$GOOD at $HILITE$MOUSE_DEVICE$NORMAL"
96     source /etc/sysconfig/mouse
97     [ -x /usr/sbin/gpm ] && gpm -m "${MOUSE_DEVICE}" -t "${MOUSETYPE}"
98     eend
99     fi
100 zhen 2
101 wolf31o2 6 if [ "$HOTPLUG" = "yes" ]; then
102     /etc/init.d/hotplug start
103 zhen 2 else
104 wolf31o2 6 ebegin $BAD"Hotplug disabled via cmdline$NORMAL"
105     fi
106 zhen 2
107 wolf31o2 6 if [ "$DETECT" = "no" ]; then
108     DHCP="no"
109     fi
110 zhen 2
111 wolf31o2 6 if [ "$DETECT" = "yes" ]; then
112     NETDEVICES="`awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null`"
113     fi
114 zhen 2
115 wolf31o2 6 if [ -n "$NETDEVICES" ]; then
116     if [ "${DHCP}" = "yes" ]; then
117     ebegin $GOOD"Network device$HILITE$NETDEVICES$GOOD detected,$WARN DHCP broadcasting for IP.$NORMAL"
118 wolf31o2 10 dhcpcd &
119 wolf31o2 6 fi
120     eend
121 zhen 2
122     else
123 zhen 4 ebegin $BAD"No Network device auto detected.$NORMAL"
124 wolf31o2 6 fi
125 zhen 2
126    
127 wolf31o2 6 if [ -n "$SOUND_FULLNAME" -o -n "$SOUND_DRIVER" ]; then
128     ebegin $GOOD"Soundcard:"
129     eend
130     if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
131     amixer scontrols > /etc/amixer
132     [ -n "`grep Master /etc/amixer`" ] && amixer set Master 75% \
133     && amixer set Master unmute
134     [ -n "`grep PCM /etc/amixer`" ] && amixer set PCM 75% \
135     && amixer set PCM unmute
136     [ -n "`grep Mic /etc/amixer`" ] && amixer set Mic 75% \
137     && amixer set Mic cap
138     [ -n "`grep Wave /etc/amixer`" ] && amixer set Wave 75% \
139     && amixer set Wave unmute
140     [ -n "`grep Capture /etc/amixer`" ] && amixer set Capture 75% \
141     && amixer set Capture cap && amixer set Capture unmute
142     fi
143     [ -n "$SOUND_FULLNAME" ]
144     ebegin " $WARN$SOUND_FULLNAME"
145     [ -n "$SOUND_DRIVER" ]
146     ebegin $WARN" driver = $SOUND_DRIVER"$HILITE
147     fi
148 zhen 2
149    
150 wolf31o2 6 if [ -n "$XDESC" -o -n "$XDESC" ]; then
151 zhen 2 ebegin $GOOD"VideoCard: $WARN ${XDESC}"
152     eend
153 wolf31o2 6 fi
154 zhen 2
155 wolf31o2 6 killall hwsetup 2>/dev/null
156     echo "6" > /proc/sys/kernel/printk
157 zhen 4
158 zhen 2 }
159 wolf31o2 6
160     # vim: ts=4

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20