Re: console-data
On Tue, Jan 25, 2000, Hartmut Koptein <koptein@inwestnet.de> wrote:
>my $arch = `dpkg --print-installation-architecture`;
>chomp $arch;
>
>if (($arch eq 'powerpc') || ($arch eq 'm68k')) {
> my $subarch;
> if ($arch eq 'powerpc') {
> my $line = `grep ^machine /proc/cpuinfo`;
> abort ($defs, "No \"machine\" field in /proc/cpuinfo") if
$line eq
>'';
> $subarch = lc substr ($line, 11);
> } elsif ($arch eq 'm68k') {
> my $line = `grep ^Model: /proc/hardware`;
> abort ($defs, "No \"Model\" field in /proc/hardware") if $line eq
>'';
> $subarch = lc substr ($line, 8);
> }
> $subarch =~ s/ .*//;
> chop($subarch);
> $subarch = 'mac' if $subarch =~
>m/^macintosh|powermac|powerbook|power|imac|powermac1/;
> $subarch = 'mvme' if $subarch eq 'motorola';
>
> $arch = "$arch/$subarch";
>}
A better approach for Power Macs would probably be the field
"motherboard" of /proc/cpuinfo, which contains the content of the device
tree "compatible" property with spaces between the tokens. You should
find a token "MacRISC" in it on any powermac, powerbook, imac, etc...
Reply to: