/[livecd-tools]/trunk/autoconfig
Gentoo

Diff of /trunk/autoconfig

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

Revision 80 Revision 81
1#!/sbin/runscript 1#!/sbin/runscript
2# Copyright 1999-2005 Gentoo Foundation 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.45 2005/10/12 18:32:00 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.46 2005/10/17 15:08:59 wolf31o2 Exp $
5 5
6DHCP="yes" 6DHCP="yes"
7DETECT="yes" 7DETECT="yes"
8GPM="yes" 8GPM="yes"
9PCMCIA="no" 9PCMCIA="no"
98} 98}
99 99
100# Only used on SGI CDs, this determines: 100# Only used on SGI CDs, this determines:
101# A) CPU Type 101# A) CPU Type
102# B) System 102# B) System
103DetectMips() { 103detect_mips() {
104 local cpuinfo="$(awk -F: '/^cpu model/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1 | cut -d" " -f2,3)" 104 local cpuinfo="$(awk -F: '/^cpu model/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1 | cut -d" " -f2,3)"
105 local machinfo="$(awk -F: '/^system type/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | cut -d" " -f2-)" 105 local machinfo="$(awk -F: '/^system type/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | cut -d" " -f2-)"
106 local machtype="" 106 local machtype=""
107 107
108 case "${machinfo}" in 108 case "${machinfo}" in
137 esac 137 esac
138 138
139 PC="Detected an ${machtype} w/ ${numcpu} ${cpuinfo} ${bit}" 139 PC="Detected an ${machtype} w/ ${numcpu} ${cpuinfo} ${bit}"
140} 140}
141 141
142detect_x86_amd64() {
143 local cpuinfo="$(awk -F: '/^model name/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)"
144 local mhz="$(awk -F: '/^cpu MHz/{printf " %dMHz",int($2)};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)"
145
146 PC="Detected ${numcpu} ${cpuinfo} ${mhz} ${bit}"
147}
142 148
143start() { 149start() {
144 echo "0" > /proc/sys/kernel/printk 150 echo "0" > /proc/sys/kernel/printk
145 get_config 151 get_config
146 if [ "${DETECT}" = "yes" ] 152 if [ "${DETECT}" = "yes" ]
148 ebegin "Hardware detection started" 154 ebegin "Hardware detection started"
149 local numcpu="$(awk -F: '/^processor/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | wc -l)" 155 local numcpu="$(awk -F: '/^processor/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | wc -l)"
150 local arch="$(uname -m)" 156 local arch="$(uname -m)"
151 local ismips="no" 157 local ismips="no"
152 [ "${numcpu}" -gt '1' ] && bit="CPUs" || bit="CPU" 158 [ "${numcpu}" -gt '1' ] && bit="CPUs" || bit="CPU"
153 if [ "${arch}" = "mips" -o "${arch}" = "mips64" ] 159 case ${arch} in
154 then 160 mips|mips64)
155 DetectMips 161 detect_mips
156 ismips="yes" 162 ismips="yes"
157 else 163 ;;
164 i386|i486|i586|i686|x86_64)
165 detect_x86_amd64
166 ;;
167 *)
158 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)" 168 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)"
159 # This is probably where we're going with this in the future 169 ;;
160 # cpuinfo="$(awk -F: '/^model name/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)" 170 esac
161 # mhz="$(awk -F: '/^cpu MHz/{printf " %dMHz",int($2)};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)"
162 # PC="Detected ${numcpu} ${cpuinfo} ${mhz} ${bit}"
163 fi
164 einfo "${PC}" 171 einfo "${PC}"
165 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null 172 [ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
166 eend 173 eend
167 else 174 else
168 ewarn "Hardware detection disabled via cmdline ..." 175 ewarn "Hardware detection disabled via cmdline ..."

Legend:
Removed from v.80  
changed lines
  Added in v.81

  ViewVC Help
Powered by ViewVC 1.1.20