/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 20 Revision 49
1#!/sbin/runscript 1#!/sbin/runscript
2# Copyright 1999-2002 Gentoo Technologies, Inc. 2# Copyright 1999-2005 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2 3# Distributed under the terms of the GNU General Public License v2
4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.11 2004/11/25 04:42:53 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.25 2005/05/12 13:04:27 wolf31o2 Exp $
5 5
6echo "0" > /proc/sys/kernel/printk 6echo "0" > /proc/sys/kernel/printk
7DHCP="yes" 7DHCP="yes"
8DETECT="yes" 8DETECT="yes"
9GPM="yes"
9PCMCIA="no" 10PCMCIA="no"
10HOTPLUG="yes" 11HOTPLUG="yes"
11APM="no" 12APM="no"
12ACPI="no" 13ACPI="no"
14IDEDMA="yes"
13CMDLINE="`cat /proc/cmdline`" 15CMDLINE="`cat /proc/cmdline`"
14for x in ${CMDLINE} ; do 16for x in ${CMDLINE} ; do
15 if [ "${x}" = "nodetect" ]; then 17 if [ "${x}" = "nodetect" ]; then
16 DETECT="no" 18 DETECT="no"
19 GPM="no"
17 HOTPLUG="no" 20 HOTPLUG="no"
18 APM="no" 21 APM="no"
19 ACPI="no" 22 ACPI="no"
20 fi 23 fi
21 24
22 if [ "${x}" = "nodhcp" ]; then 25 if [ "${x}" = "nodhcp" ]; then
23 DHCP="no" 26 DHCP="no"
27 fi
28
29 if [ "${x}" = "nogpm" ]; then
30 GPM="no"
24 fi 31 fi
25 32
26 if [ "${x}" = "dopcmcia" ]; then 33 if [ "${x}" = "dopcmcia" ]; then
27 PCMCIA="yes" 34 PCMCIA="yes"
28 fi 35 fi
30 if [ "${x}" = "doapm" ]; then 37 if [ "${x}" = "doapm" ]; then
31 APM="yes" 38 APM="yes"
32 ACPI="no" 39 ACPI="no"
33 fi 40 fi
34 41
35 if [ "${x}" = "acpi=on" ]; then 42 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force" ]; then
36 APM="no" 43 APM="no"
37 ACPI="yes" 44 ACPI="yes"
38 fi 45 fi
39 46
47 if [ "${x}" = "ide=nodma" ]; then
48 IDEDMA="no"
49 fi
50
40 if [ "${x}" = "nohotplug" ]; then 51 if [ "${x}" = "nohotplug" ]; then
41 HOTPLUG="no" 52 HOTPLUG="no"
42 fi 53 fi
43done 54done
44 55
45depend() { 56depend() {
46 need modules 57 need modules
58 use alsasound
59# provide gpm pcmcia apmd acpid coldplug
47} 60}
48 61
49start() { 62start() {
50 if [ "${DETECT}" = "yes" ]; then 63 if [ "${DETECT}" = "yes" ]; then
51 ebegin ${WARN}"Hardware detection started" 64 ebegin ${WARN}"Hardware detection started"
57 else 70 else
58 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL" 71 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
59 fi 72 fi
60 73
61 if [ "${APM}" = "yes" ]; then 74 if [ "${APM}" = "yes" ]; then
62 insmod apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}" 75 modprobe apm power_off=1 >/dev/null 2>&1 && ebegin ${GOOD}"APM BIOS found, power management functions enabled.${NORMAL}"
63 /etc/init.d/apmd start 76 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
64 else 77 else
65 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}" 78 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
66 eend 79 eend
67 fi 80 fi
68 81
69 if [ "${ACPI}" = "yes" ]; then 82 if [ "${ACPI}" = "yes" ]; then
70 insmod processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && insmod thermal >/dev/null 83 modprobe processor >/dev/null 2>&1 && ebegin ${GOOD} ACPI power management functions enabled.${NORMAL} && modprobe thermal >/dev/null
71 insmod fan >/dev/null 2>&1 84 modprobe fan >/dev/null 2>&1
72 insmod button >/dev/null 2>&1 85 modprobe button >/dev/null 2>&1
73 insmod battery >/dev/null 2>&1 86 modprobe battery >/dev/null 2>&1
74 insmod ac >/dev/null 2>&1 87 modprobe ac >/dev/null 2>&1
75 /etc/init.d/acpid start 88 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
76 eend 89 eend
90 fi
91
92 if [ "${IDEDMA}" = "yes" ]; then
93 [ -x /etc/init.d/hdparm ] && /etc/init.d/hdparm start
77 fi 94 fi
78 95
79 if [ "${PCMCIA}" = "yes" ]; then 96 if [ "${PCMCIA}" = "yes" ]; then
80 ebegin ${HILITE} "PCMCIA enabled via cmdline" 97 ebegin ${HILITE} "PCMCIA enabled via cmdline"
81 /etc/init.d/pcmcia start 98 /etc/init.d/pcmcia start
82 fi 99 fi
83 100
84 if [ "${DHCP}" = "no" ]; then 101 if [ "${DHCP}" = "no" ]; then
85 sed -i -e 's/ifconfig_eth0=( "dhcp" )/#ifconfig_eth0=( "dhcp" )/' \ 102 sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
86 sed -i -e 's/ifconfig_eth1=( "dhcp" )/#ifconfig_eth1=( "dhcp" )/' \ 103 -e '/^iface_eth.*dhcp.*/ s/^/#/' \
87 sed -i -e 's/ifconfig_eth2=( "dhcp" )/#ifconfig_eth2=( "dhcp" )/' \
88 sed -i -e 's/ifconfig_eth3=( "dhcp" )/#ifconfig_eth3=( "dhcp" )/' \
89 /etc/conf.d/net 104 /etc/conf.d/net
90 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline." 105 ebegin ${BAD}"Skipping DHCP broadcast detection as requested on boot commandline."
91 fi 106 fi
92 107
93 #Read in what hwsetup has found 108 #Read in what hwsetup has found
94 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix 109 [ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
95 110
96 # Mouse 111 # Mouse
97 if [ -n "${MOUSE_DEVICE}" ]; then 112 if [ -n "${MOUSE_DEVICE}" ]; then
98 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}" 113 ebegin ${GOOD}"Mouse is ${HILITE}${MOUSE_FULLNAME}${GOOD} at ${HILITE}${MOUSE_DEVICE}${NORMAL}"
99 source /etc/sysconfig/mouse 114 source /etc/sysconfig/mouse
100 [ -x /usr/sbin/gpm ] && gpm -m "${MOUSE_DEVICE}" -t "${MOUSETYPE}" 115 if [ -x /usr/sbin/gpm ]; then
116 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
117 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
118 else
119 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
120 fi
121 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
122 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
123 else
124 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
125 fi
126 if [ "$GPM" = "yes" ]; then
127 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
128 fi
129 fi
101 eend 130 eend
102 fi 131 fi
103 132
104 if [ "${HOTPLUG}" = "yes" ]; then 133 if [ "${HOTPLUG}" = "yes" ]; then
105 #Check whether we should be using hotplug or coldplug 134 #Check whether we should be using hotplug or coldplug
106 if [ -x /etc/init.d/coldplug ]; then 135 if [ -x /etc/init.d/coldplug ]; then
107 /etc/init.d/coldplug start 136 /etc/init.d/coldplug start
108 else 137 else
109 /etc/init.d/hotplug start 138 [ -x /etc/init.d/hotplug ] && /etc/init.d/hotplug start
110 fi 139 fi
111 else 140 else
112 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}" 141 ebegin ${BAD}"Hotplug disabled via cmdline${NORMAL}"
113 fi 142 fi
114 143
121 fi 150 fi
122 151
123 if [ -n "${NETDEVICES}" ]; then 152 if [ -n "${NETDEVICES}" ]; then
124 if [ "${DHCP}" = "yes" ]; then 153 if [ "${DHCP}" = "yes" ]; then
125 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}" 154 ebegin ${GOOD}"Network device${HILITE}${NETDEVICES}${GOOD} detected,${WARN} DHCP broadcasting for IP.${NORMAL}"
126 dhcpcd & 155 dhcpcd -h $(hostname) &
127 fi 156 fi
128 eend 157 eend
129 158
130 else 159 else
131 ebegin ${BAD}"No Network device auto detected.${NORMAL}" 160 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
139 ebegin " ${WARN}${SOUND_FULLNAME}" 168 ebegin " ${WARN}${SOUND_FULLNAME}"
140 [ -n "${SOUND_DRIVER}" ] 169 [ -n "${SOUND_DRIVER}" ]
141 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE} 170 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
142 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then 171 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
143 amixer scontrols > /etc/amixer 172 amixer scontrols > /etc/amixer
144 [ -n "`grep Master /etc/amixer`" ] && amixer -q set Master 75% \ 173 if [ -n "`grep Master /etc/amixer`" ]
145 && amixer -q set Master unmute 174 then
146 [ -n "`grep PCM /etc/amixer`" ] && amixer -q set PCM 75% \ 175 amixer -q set Master 95% unmute >/dev/null 2>&1
147 && amixer -q set PCM unmute 176 fi
148 [ -n "`grep Mic /etc/amixer`" ] && amixer -q set Mic 75% \ 177 if [ -n "`grep PCM /etc/amixer`" ]
149 && amixer -q set Mic cap 178 then
150 [ -n "`grep Wave /etc/amixer`" ] && amixer -q set Wave 75% \ 179 amixer -q set PCM 95% unmute >/dev/null 2>&1
151 && amixer -q set Wave unmute 180 fi
152 [ -n "`grep Capture /etc/amixer`" ] && amixer -q set Capture 75% \ 181 if [ -n "`grep Mic /etc/amixer`" ]
153 && amixer -q set Capture cap && amixer -q set Capture unmute 182 then
183 amixer -q set Mic 95% unmute cap >/dev/null 2>&1
184 fi
185 if [ -n "`grep Wave /etc/amixer`" ]
186 then
187 amixer -q set Wave 95% unmute >/dev/null 2>&1
188 fi
189 if [ -n "`grep Capture /etc/amixer`" ]
190 then
191 amixer -q set Capture 95% unmute cap >/dev/null 2>&1
192 fi
154 fi 193 fi
155 fi 194 fi
156 195
157 196
158 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then 197 if [ -n "${XDESC}" -o -n "${XDESC}" ]; then

Legend:
Removed from v.20  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.20