diff options
author | 2006-01-20 19:56:38 +0000 | |
---|---|---|
committer | 2006-01-20 19:56:38 +0000 | |
commit | 4503668e58e7ff266a7452e242df2e8a79efc494 (patch) | |
tree | a935bec35796e363668b1b10ddd595df898a0b68 | |
parent | Cause Nvidia check to look for either NV or nv, in case of broken pci.ids file. (diff) | |
download | livecd-tools-4503668e58e7ff266a7452e242df2e8a79efc494.tar.gz livecd-tools-4503668e58e7ff266a7452e242df2e8a79efc494.tar.bz2 livecd-tools-4503668e58e7ff266a7452e242df2e8a79efc494.zip |
Added an initial detect_ppc function, which I hope to improve over time.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/livecd-tools/trunk@89 7bf51bff-881f-0410-a643-fba68b97345e
-rwxr-xr-x | autoconfig | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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.50 2005/12/05 23:06:34 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.51 2006/01/20 19:56:38 wolf31o2 Exp $ DHCP="yes" DETECT="yes" @@ -146,6 +146,24 @@ detect_x86_amd64() { PC="Detected ${numcpu} ${cpuinfo} ${mhz} ${bit}" } +detect_ppc() { + local cpuinfo="$(awk -F: '/^cpu/{printf $2};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)" + local mhz="$(awk -F: '/^clock/{printf " %dMHz",int($2)};/^$/{print ""}' /proc/cpuinfo 2>/dev/null | head -n 1)" + local machinfo="$(awk -F: '/^detected as/{printf $2}' /proc/cpuinfo | cut -d'(' -f2 | cut -d')' -f1)" + local machtype="" + + case "${machinfo}" in + "PowerMac G4 AGP Graphics") + machtype="Apple PowerMac G4" + ;; + *) + machtype="Unknown PPC System" + ;; + esac + + PC="Detected an ${machtype} w/ ${numcpu} ${cpuinfo} ${bit}" +} + start() { echo "0" > /proc/sys/kernel/printk get_config |