/[livecd-tools]/trunk/autoconfig
Gentoo

Contents of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Sun Mar 21 19:46:44 2004 UTC (10 years, 4 months ago) by zhen
File size: 3909 byte(s)
new livecd-tools packages

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20