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

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

 



<quoting>
> 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

You could try running an additional "post-install" script after
the first installation and reboot.  I got this method previously
on the list, and then changed my PostInstall.sh to do alot of
other post-install stuff.  I put the PostInstall.sh on the
kickstart floppy disk and copy it over during the ks %post:

<in ks.cfg>
...
blah blah
...

%post
cd /mnt
mount floppy
cp /mnt/floppy/PostInstall.sh /etc
chmod 700 /etc/PostInstall.sh
cat <<EOF >> /etc/rc.local
if [ -x /etc/PostInstall.sh ]; then
/etc/PostInstall.sh
fi
EOF
<end of ks.cfg>

<in PostInstall.sh>
#!/bin/sh

#check for 2-cpus
if <2-cpus exist>
  recompile kernel special way
fi

#make sure that you dont execute it next time you reboot
chmod u-x /etc/PostInstall.sh

reboot
<end of PostInstall.sh>


This would involve an extra reboot, but if you
include the line "reboot" in the first part of
ks.cfg, it will do it automatically and you
wont have to do anything.





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux