detecting i386 or x86_64 in kickstart

Panu Matilainen pmatilai at laiskiainen.org
Fri Jan 26 08:28:57 UTC 2007


On Thu, 25 Jan 2007, Jason Edgecombe wrote:

> Hi,
>
> I would like to have a unified kickstart file for both my i386 and x86_64 
> installs. So I have two questions:
>
> 1. Is there some way to detect whether the processor is 32/64 bit in a %pre 
> script?

Plenty of ways, /proc/cpuinfo for example, or uname output, or from python 
you can do

import rpmUtils.arch
arch = rpmUtils.arch.getBaseArch()

which gives you i386/x86_64 (unlike uname which gives i686/x86_64) so it 
can be directly used in install path. The tricky bit is to get the 
anaconda to actually use the path specified from %pre, as it's actually 
the loader which parses the method from the kickstart file and passes it 
to anaconda with a command line option. Can be done but requires fiddling 
with the boot images, or (ab)using updates.img.

> 2. Will the 32-bt installer install the 64bit rpms if I point it at a 64bit 
> install tree?

Almost certainly no. Trying to install x86_64 rpm's on x86 will fail 
unless rpm(lib) is forced to ignore the arch, which is not the case at 
least with FC5 and newer where anaconda is using yum, and I'd be surprised 
if it did that in earlier versions either.

Even if rpm was told to ignore the arch, there are many things 
that could (and most likely would) go wrong in such a scenario:
- if you run 32bit kernel on x86_64 it wont report itself as x86_64 but
   i686 or athlon, this will cause various places (including anaconda
   itself) with arch-specific tweaks and hacks to do wrong things
- all data created during the install (by package scripts or anaconda
   directly) would have to be arch and 32 vs 64bit independent, this is
   by no means obviously so

 	- Panu -




More information about the Kickstart-list mailing list