/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations) (download)
Fri Apr 30 22:52:02 2004 UTC (14 years, 3 months ago) by zhen
File size: 3501 byte(s)
fixed up autoconfig

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20