Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 2003 00:46:43 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   How to detect SMP-capable machines?
Message-ID:  <200311042346.hA4Nkhcw005639@lurza.secnetix.de>

next in thread | raw e-mail | index | archive | help
Hi,

First of all, thanks to everyone involved for another great
release.  :)

I'm preparing a boot/install CD which is intended to be
used to install FreeBSD on different kinds of servers.
In particular, there are SMP and UP systems.  However,
4-stable SMP kernels do not run on UP systems, unfortu-
nately.  Therefore, the script on the install CD has to
find out whether an SMP kernel or a UP kernel has to be
installed.

Now the question:  What's the best way to determine an
SMP-capable system, i.e. a system which is able to run
an SMP kernel?  It has to be done from within a shell
script.  Furthermore, the kernel booted from the CD has
to be a UP kernel, for obvious reasons, so grepping in
dmesg or sysctl is not much help, as far as I can tell.

So far, the best idea that came to my mind is to call
mptable and check the return code -- if it's 0, install
the SMP kernel, otherwise install the UP kernel.
Would that work?  Is an SMP kernel guaranteed to run
on all machines on which mptable returns success?

Or is there a better way to solve the problem?

Thanks in advance for any advice!

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

(On the statement print "42 monkeys" + "1 snake":)  By the way,
both perl and Python get this wrong.  Perl gives 43 and Python
gives "42 monkeys1 snake", when the answer is clearly "41 monkeys
and 1 fat snake".        -- Jim Fulton



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311042346.hA4Nkhcw005639>