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

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



Post install scripts run in a ramdisk environment.  The filesystem for the
ramdisk environment, for RH 7.1,  is in the RedHat/base/stage2.img file,
on the first CD.  Copy the stage2.img file to disk, and do:

# cd <to a directory where you want to mount the stage2 filesystem>
# mkdir stage2
# mount stage2.img stage2 -o loop	# mount stage2 using the loopback device
# cd stage2
# ls					# this is the "root" of the ramdisk
# cd usr/lib/anaconda
# cp <the directory where smp.py lives>/smp.py smp.py	# see NOTE, below
# chmod 755 smp.py
# cd <back to where you mounted the stage2 filesystem>
# umount stage2

NOTE: I put my extra python scripts into the anaconda directory, along
with the other python scripts which anaconda uses.  You'll have to add
/usr/lib/anaconda to your PATH in your kickstart post-install script.
Or, you can put the script in one of the other directories used
by default by post-install scripts.  And, no, I don't remember that
PATH off the top of my head; I think it includes /bin and /usr/bin.

Now that you have a modified stage2.img, to use it, you'll either need
to re-burn the CD, or do an over-the-network install.

For burning a RedHat CD, start with:

http://www.linuxdoc.org/HOWTO/RedHat-CD-HOWTO.html

That document may be getting a little out of date, though.

For over-the-network installs, there have been previous articles on this list
about how to do a network install, how to consolidate CD1 and CD2 into a
single directory, and so on.

--Seth Alford
setha plaza ds adp com

On Fri, Feb 08, 2002 at 10:00:44AM -0600, Rebecca R Hepper seagate com wrote:
> 
> Thanks for all the ideas on how to tackle this problem!!
> 
> My plan is to first try out  the suggestion below.   What directories can
> the post-install script execute?   My script never even shows up when I
> copy it to /tmp, /usr, /var  or /etc.
> 
> Thanks!
> 
> 
> 
>                                                                                                                            
>                     "Seth D. Alford"                                                                                       
>                     <setha plaza ds adp c        To:     kickstart-list redhat com                                         
>                     om>                          cc:                                                                       
>                     Sent by:                     Subject:     Re: Determining if system has multiple processors in %post   
>                     kickstart-list-admin@        section                                                                   
>                     redhat.com                                                                                             
>                                                                                                                            
>                                                                                                                            
>                     02/07/2002 03:37 PM                                                                                    
>                     Please respond to                                                                                      
>                     kickstart-list                                                                                         
>                                                                                                                            
>                                                                                                                            
> 
> 
> 
> 
> 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
> >
> ....
> 
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list redhat com
> https://listman.redhat.com/mailman/listinfo/kickstart-list
> 
> 
> 
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list redhat com
> https://listman.redhat.com/mailman/listinfo/kickstart-list





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