From owner-freebsd-stable@FreeBSD.ORG Tue Nov 4 15:46:47 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6F0416A4CE for ; Tue, 4 Nov 2003 15:46:47 -0800 (PST) Received: from lurza.secnetix.de (lurza.secnetix.de [195.143.231.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D53843F3F for ; Tue, 4 Nov 2003 15:46:46 -0800 (PST) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ilclej@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.9p1/8.12.8) with ESMTP id hA4NkiOC005640 for ; Wed, 5 Nov 2003 00:46:44 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.9p1/8.12.8/Submit) id hA4Nkhcw005639; Wed, 5 Nov 2003 00:46:43 +0100 (CET) Date: Wed, 5 Nov 2003 00:46:43 +0100 (CET) Message-Id: <200311042346.hA4Nkhcw005639@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.8-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: How to detect SMP-capable machines? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2003 23:46:48 -0000 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