CPU Arch Detection

Sergey Tikhonov tsv at solvo.ru
Sun Oct 23 17:13:24 UTC 2005


Sergey Tikhonov wrote:

> Michal Jaegermann wrote:
>
>> On Sat, Oct 22, 2005 at 10:35:57PM +0400, Sergey Tikhonov wrote:
>>  
>>
>>> The above "arch_compat" macros says that "alpha" packages can be
>>> installed on "alphaev6" arch not the way around.
>>>   
>>
>>
>> Are you sure?  'athlon', for example, seems to follow a similar
>> chain to 'i386' as 'alphaev6' to alpha and I do not recall ever
>> seeing complaints that 'athlon', or 'i686', packages are of a wrong
>> architecture for on an i386 installation.
>>  
>>
> Well, let me dig into my e-mails (on Monday). I was writing based on 
> my memory.
> I recall I was working on that issue in January in preparation of AC1 
> release, but was
> not able to test it on real ev6 machine. It seemed that everything was 
> ready in rpm source
> code and during debugging I fooled CPU detection code that I had ev6 
> machine and ev6 package
> installed without problems. I could take a look the issue again if I 
> had access to ev6 class machine
> (Mike? :) ).

Ok, here are findings (Mike thank you for access to ev6 machine).
The rpm tries to take value for _host_cpu variable from 
/etc/rpm/platform file (it contains machine-vendor-os triplet).
As other mentioned here the file itself is created by anaconda (I didn't 
know that).
If the file doesn't exist - the rpm uses "uname" call and then tries to 
use implver and amask to find out exact cpu type
and sets _host_cpu variable. So, rpm works correctly - it is just a 
matter corretly create /etc/rpm/platform file. :)

I still believe that "arch_compat" macro defines upward compatibility 
and has meaning:
alpha_compat: arch2: arch1 - that packages of arch1 can be installed on 
arch2 (try to comment out the line with "noarch"
dependency and install noarch package and rpm would reject to install 
noarch package).

Regards,
Sergey.

tsv at solvo.ru




More information about the axp-list mailing list