/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

Revision 26 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.15 2005/01/28 16:43:28 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" 9GPM="yes"
10PCMCIA="no" 10PCMCIA="no"
11HOTPLUG="yes" 11HOTPLUG="yes"
12APM="no" 12APM="no"
13ACPI="no" 13ACPI="no"
14IDEDMA="yes"
14CMDLINE="`cat /proc/cmdline`" 15CMDLINE="`cat /proc/cmdline`"
15for x in ${CMDLINE} ; do 16for x in ${CMDLINE} ; do
16 if [ "${x}" = "nodetect" ]; then 17 if [ "${x}" = "nodetect" ]; then
17 DETECT="no" 18 DETECT="no"
18 GPM="no" 19 GPM="no"
23 24
24 if [ "${x}" = "nodhcp" ]; then 25 if [ "${x}" = "nodhcp" ]; then
25 DHCP="no" 26 DHCP="no"
26 fi 27 fi
27 28
29 if [ "${x}" = "nogpm" ]; then
30 GPM="no"
31 fi
32
28 if [ "${x}" = "dopcmcia" ]; then 33 if [ "${x}" = "dopcmcia" ]; then
29 PCMCIA="yes" 34 PCMCIA="yes"
30 fi 35 fi
31 36
32 if [ "${x}" = "doapm" ]; then 37 if [ "${x}" = "doapm" ]; then
33 APM="yes" 38 APM="yes"
34 ACPI="no" 39 ACPI="no"
35 fi 40 fi
36 41
37 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force"]; then 42 if [ "${x}" = "acpi=on" -o "${x}" = "acpi=force" ]; then
38 APM="no" 43 APM="no"
39 ACPI="yes" 44 ACPI="yes"
40 fi 45 fi
41 46
47 if [ "${x}" = "ide=nodma" ]; then
48 IDEDMA="no"
49 fi
50
42 if [ "${x}" = "nohotplug" ]; then 51 if [ "${x}" = "nohotplug" ]; then
43 HOTPLUG="no" 52 HOTPLUG="no"
44 fi 53 fi
45done 54done
46 55
47depend() { 56depend() {
48 need modules 57 need modules
58 use alsasound
59# provide gpm pcmcia apmd acpid coldplug
49} 60}
50 61
51start() { 62start() {
52 if [ "${DETECT}" = "yes" ]; then 63 if [ "${DETECT}" = "yes" ]; then
53 ebegin ${WARN}"Hardware detection started" 64 ebegin ${WARN}"Hardware detection started"
59 else 70 else
60 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL" 71 ebegin ${WARN}"Hardware detection disabled via cmdline$NORMAL"
61 fi 72 fi
62 73
63 if [ "${APM}" = "yes" ]; then 74 if [ "${APM}" = "yes" ]; then
64 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}"
65 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start 76 [ -x /etc/init.d/apmd ] && /etc/init.d/apmd start
66 else 77 else
67 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}" 78 ebegin ${GOOD}"Not Loading APM Bios support.${NORMAL}"
68 eend 79 eend
69 fi 80 fi
70 81
71 if [ "${ACPI}" = "yes" -o "${ACPI}" = "force" ]; then 82 if [ "${ACPI}" = "yes" ]; then
72 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
73 insmod fan >/dev/null 2>&1 84 modprobe fan >/dev/null 2>&1
74 insmod button >/dev/null 2>&1 85 modprobe button >/dev/null 2>&1
75 insmod battery >/dev/null 2>&1 86 modprobe battery >/dev/null 2>&1
76 insmod ac >/dev/null 2>&1 87 modprobe ac >/dev/null 2>&1
77 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start 88 [ -x /etc/init.d/acpid ] && /etc/init.d/acpid start
78 eend 89 eend
90 fi
91
92 if [ "${IDEDMA}" = "yes" ]; then
93 [ -x /etc/init.d/hdparm ] && /etc/init.d/hdparm start
79 fi 94 fi
80 95
81 if [ "${PCMCIA}" = "yes" ]; then 96 if [ "${PCMCIA}" = "yes" ]; then
82 ebegin ${HILITE} "PCMCIA enabled via cmdline" 97 ebegin ${HILITE} "PCMCIA enabled via cmdline"
83 /etc/init.d/pcmcia start 98 /etc/init.d/pcmcia start
84 fi 99 fi
85 100
86 if [ "${DHCP}" = "no" ]; then 101 if [ "${DHCP}" = "no" ]; then
87 sed -i -e '/^ifconfig_eth/ s//^#/' \ 102 sed -i -e '/^ifconfig_eth.*dhcp.*/ s/^/#/' \
88 -e '/^iface_eth/ s//^#/' \ 103 -e '/^iface_eth.*dhcp.*/ s/^/#/' \
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
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 if [ -x /usr/sbin/gpm ]; then 115 if [ -x /usr/sbin/gpm ]; then
101 if [ "grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm" ]; then 116 if [ `grep "#MOUSE=${MOUSETYPE}" /etc/conf.d/gpm` ]; then
102 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm 117 sed -i "\@MOUSE=${MOUSETYPE}@s@^#@@" /etc/conf.d/gpm
103 else 118 else
104 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm 119 echo "MOUSE=${MOUSETYPE}" >>/etc/conf.d/gpm
105 fi 120 fi
106 if [ "grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm" ]; then 121 if [ `grep "#MOUSEDEV=${DEVICE}" /etc/conf.d/gpm` ]; then
107 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm 122 sed -i "\@MOUSEDEV=${DEVICE}@s@^#@@" /etc/conf.d/gpm
108 else 123 else
109 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm 124 echo "MOUSEDEV=${DEVICE}" >>/etc/conf.d/gpm
110 fi 125 fi
111 if [ "$GPM" = "yes" ]; then 126 if [ "$GPM" = "yes" ]; then
112 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start 127 [ -x /etc/init.d/gpm ] && /etc/init.d/gpm start
113 fi 128 fi
129 fi
114 eend 130 eend
115 fi 131 fi
116 132
117 if [ "${HOTPLUG}" = "yes" ]; then 133 if [ "${HOTPLUG}" = "yes" ]; then
118 #Check whether we should be using hotplug or coldplug 134 #Check whether we should be using hotplug or coldplug
134 fi 150 fi
135 151
136 if [ -n "${NETDEVICES}" ]; then 152 if [ -n "${NETDEVICES}" ]; then
137 if [ "${DHCP}" = "yes" ]; then 153 if [ "${DHCP}" = "yes" ]; then
138 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}"
139 dhcpcd -h `basename hostname` & 155 dhcpcd -h $(hostname) &
140 fi 156 fi
141 eend 157 eend
142 158
143 else 159 else
144 ebegin ${BAD}"No Network device auto detected.${NORMAL}" 160 ebegin ${BAD}"No Network device auto detected.${NORMAL}"
154 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE} 170 ebegin ${WARN}" driver = ${SOUND_DRIVER}"${HILITE}
155 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then 171 if [ -d /proc/asound/card0 ] && [ -x /usr/bin/amixer ]; then
156 amixer scontrols > /etc/amixer 172 amixer scontrols > /etc/amixer
157 if [ -n "`grep Master /etc/amixer`" ] 173 if [ -n "`grep Master /etc/amixer`" ]
158 then 174 then
159 amixer -q set Master 75% >/dev/null 2>&1
160 amixer -q set Master unmute >/dev/null 2>&1 175 amixer -q set Master 95% unmute >/dev/null 2>&1
161 fi 176 fi
162 if [ -n "`grep PCM /etc/amixer`" ] 177 if [ -n "`grep PCM /etc/amixer`" ]
163 then 178 then
164 amixer -q set PCM 75% >/dev/null 2>&1
165 amixer -q set PCM unmute >/dev/null 2>&1 179 amixer -q set PCM 95% unmute >/dev/null 2>&1
166 fi 180 fi
167 if [ -n "`grep Mic /etc/amixer`" ] 181 if [ -n "`grep Mic /etc/amixer`" ]
168 then 182 then
169 amixer -q set Mic 75% >/dev/null 2>&1
170 amixer -q set Mic cap >/dev/null 2>&1 183 amixer -q set Mic 95% unmute cap >/dev/null 2>&1
171 fi 184 fi
172 if [ -n "`grep Wave /etc/amixer`" ] 185 if [ -n "`grep Wave /etc/amixer`" ]
173 then 186 then
174 amixer -q set Wave 75% >/dev/null 2>&1
175 amixer -q set Wave unmute >/dev/null 2>&1 187 amixer -q set Wave 95% unmute >/dev/null 2>&1
176 fi 188 fi
177 if [ -n "`grep Capture /etc/amixer`" ] 189 if [ -n "`grep Capture /etc/amixer`" ]
178 then 190 then
179 amixer -q set Capture 75% >/dev/null 2>&1
180 amixer -q set Capture cap >/dev/null 2>&1
181 amixer -q set Capture unmute >/dev/null 2>&1 191 amixer -q set Capture 95% unmute cap >/dev/null 2>&1
182 fi 192 fi
183 fi 193 fi
184 fi 194 fi
185 195
186 196

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

  ViewVC Help
Powered by ViewVC 1.1.20