Re: Upgrade script....

Bernhard Rosenkraenzer <[email protected]> Sat, 5 Mar 2005 02:19:29 +0100
Newsgroups gmane.linux.arklinux.devel
Organization Ark Linux team
Message-ID <[email protected]>
On Saturday 05 March 2005 02:12, Gary L. Greene Jr. wrote:
> This can be modified since it's under GPL for whatever reason...

Looks good... I've attached a patch to make it even easier to use by 
autodetecting whether or not the system is SMP rather than asking the user.

LLaP
bero
a2b-autodetect-smp.patch (text/x-diff, 1.1 KB)
--- arklinux/a2b-update-tool.sh.ark	2005-03-05 02:16:30.000000000 +0100
+++ arklinux/a2b-update-tool.sh	2005-03-05 02:18:04.000000000 +0100
@@ -169,18 +169,6 @@
     echo "be reset!"
 }
 
-SMPCheckInput() {
-    echo -n "Is this a multiprocessor system? [y/n]"
-    read smpval
-    if [ $smpval == 'y' -o $smpval == 'n' ] ; then
-	export smpval;
-        Continue2
-    else
-        echo "Incorrect input."
-        SMPCheck
-    fi
-}
-
 SMPCheck() {
     clear
     echo -en '\033[4m''\E[31m'"Ark "
@@ -188,12 +176,13 @@
     echo -e '\E[39m'" Alpha12 to Beta1 update tool"'\033[0m'
     echo ""
     echo ""
-    echo "Computers with multiple CPUs require special setup in order to achieve"
-    echo "optimal performance.  If your computer has multiple CPUs, you should "
-    echo "select 'Y' now.  If you are not sure, it is safe to select 'Y' here."
-    echo "Otherwise, select 'N' now."
-    echo ""
-    SMPCheckInput
+    if [ "`getconf _NPROCESSORS_ONLN`" -gt 1 ]; then
+        smpval=y
+    else
+        smpval=n
+    fi
+    export smpval
+    Continue2
 }
 
 Continue1input() {