summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Gianelloni <wolf31o2@gentoo.org>2005-10-12 17:42:25 +0000
committerChris Gianelloni <wolf31o2@gentoo.org>2005-10-12 17:42:25 +0000
commitf8d0e24ad83228e687d275478515f4cdc9d94142 (patch)
tree2a7e369c8b14c646636eed6fc9a81ccb8fc47fcb /src/livecd-tools
parentAdded patch from Joshua Kinard <kumba@gentoo.org> for bug #106988. (diff)
downloadgentoo-f8d0e24ad83228e687d275478515f4cdc9d94142.tar.gz
gentoo-f8d0e24ad83228e687d275478515f4cdc9d94142.tar.bz2
gentoo-f8d0e24ad83228e687d275478515f4cdc9d94142.zip
Added patch from Joshua Kinard <kumba@gentoo.org> for bug #106990.
Diffstat (limited to 'src/livecd-tools')
-rw-r--r--src/livecd-tools/autoconfig68
1 files changed, 63 insertions, 5 deletions
diff --git a/src/livecd-tools/autoconfig b/src/livecd-tools/autoconfig
index 576ae63f2d..7e3b2292fe 100644
--- a/src/livecd-tools/autoconfig
+++ b/src/livecd-tools/autoconfig
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.43 2005/10/12 17:15:27 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.44 2005/10/12 17:42:25 wolf31o2 Exp $
DHCP="yes"
DETECT="yes"
@@ -97,13 +97,69 @@ list_services() {
echo ${svcs}
}
+# Only used on SGI CDs, this determines:
+# A) Number of CPUs
+# B) CPU Type
+# C) System
+DetectMips() {
+ local numcpu="$(awk -F: '/^processor/{printf $2"\n"};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | wc -l)"
+ local cpuinfo="$(awk -F: '/^cpu model/{printf $2"\n"};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1 | cut -d" " -f2,3)"
+ local machinfo="$(awk -F: '/^system type/{printf $2"\n"};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | cut -d" " -f2-)"
+ local machtype=""
+ local bit=""
+
+ case "${machinfo}" in
+ "SGI Indy")
+ machtype="SGI Indy" # Indy R4x00/R5000
+ ;;
+ "SGI Indigo2")
+ case "${cpuinfo}" in
+ R4*)
+ machtype="SGI Indigo2" # I2 R4x00
+ ;;
+ R8*)
+ machtype="SGI Indigo2 Power" # I2 R8000
+ ;;
+ R10*)
+ machtype="SGI Indigo2 Impact" # I2 R10000
+ ;;
+ esac
+ ;;
+ "SGI O2"|"SGI IP32")
+ machtype="SGI O2" # O2 R5K/RM5K2/RM7K/R10K/R12K
+ ;;
+ "SGI Octane"|"SGI IP30")
+ machtype="SGI Octane" # Octane R10K/R12K/R14K
+ ;;
+ "SGI Origin"|"SGI IP27")
+ machtype="SGI Origin" # Origin R10K/R12K
+ ;;
+ *)
+ machtype="Unknown SGI MIPS" # ???
+ ;;
+ esac
+
+ [ "${numcpu}" -gt '1' ] && bit="CPUs" || bit="CPU"
+
+ PC="Detected an ${machtype} w/ ${numcpu} ${cpuinfo} ${bit}"
+}
+
+
start() {
echo "0" > /proc/sys/kernel/printk
get_config
if [ "${DETECT}" = "yes" ]
then
ebegin "Hardware detection started"
- 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)"
+ local mach="$(uname -m)"
+ local ismips="no"
+ if [ "${mach}" = "mips" -o "${mach}" = "mips64" ]
+ then
+ DetectMips
+ ismips="yes"
+ else
+ 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)"
+ fi
einfo "${PC}"
[ -x /usr/sbin/hwsetup ] && hwsetup -p >/dev/null
eend
@@ -117,7 +173,7 @@ start() {
einfo "APM BIOS found, power management functions enabled ..."
[ -x /etc/init.d/apmd ] && start_service apmd
else
- ewarn "Not Loading APM Bios support ..."
+ [ "${ismips}" = "no" ] && ewarn "Not Loading APM Bios support ..."
fi
if [ "${ACPI}" = "yes" ]
@@ -132,12 +188,14 @@ start() {
[ -x /etc/init.d/acpid ] && start_service acpid
eend
else
- ewarn "Not Loading ACPI support ..."
+ [ "${ismips}" = "no" ] && ewarn "Not Loading ACPI support ..."
fi
if [ "${IDEDMA}" = "yes" ]
then
- [ -x /etc/init.d/hdparm ] && start_service hdparm
+ if [ "${ismips}" = "no" ]; then
+ [ -x /etc/init.d/hdparm ] && start_service hdparm
+ fi
fi
if [ "${PCMCIA}" = "yes" ]