[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Determining if system has multiple processors in %post section



Here's a small python script, smp.py, that I use with RH 7.1:

#! /usr/bin/python
# $Id: smp.py /main/2 2001/08/13 11:38:02 setha Exp $
import isys
import sys
sys.exit(isys.smpAvailable())

----end of script----

This script uses the isys module, which is what anaconda uses internally.

To use this in a post-install environment, you have to put the script
in directory where your post-install script can execute it.  Your post
script will have to enable a PYTHONPATH.  Here's what I use for my PYTHONPATH:

export PYTHONPATH=/tmp/updates:/usr/lib/anaconda:/usr/lib/anaconda/textw:/usr/lib/anaconda/iw:/usr/lib/anaconda/installclasses

I'm not sure that the PYTHONPATH is correct.  And I assume that the isys
module knows how to do the right thing.

--Seth Alford
setha plaza ds adp com

On Thu, Feb 07, 2002 at 03:00:35PM -0600, Rebecca R Hepper seagate com wrote:
> Hello list,
> 
> In the %post section I need to determine how many processors my system has.
> If there is one processor I will install my recompiled kernel, otherwise
> I'll let the default be the smp-kernel.  I thought I could grep the
> /proc/cpuinfo file to determine the number of processors but during
> kickstart it only shows one processor even though my system has two.  The
> file doesn't seem to get updated with information for the second processor
> until the system boots into the smp-kernel.  Any thoughts/hints on how I
> could determine the number of processors in the system?  How does anaconda
> automagically know when there are multiple processors?
> 
> Thank you.
> 
> Rebecca
> 
....





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]