diff -Nur -x '*.orig' -x '*.rej' booty-0.44.4/bootloaderInfo.py mezzanine_patched_booty-0.44.4/bootloaderInfo.py --- booty-0.44.4/bootloaderInfo.py 2007-05-17 22:25:24.000000000 -0600 +++ mezzanine_patched_booty-0.44.4/bootloaderInfo.py 2007-05-17 22:23:04.000000000 -0600 @@ -727,10 +727,36 @@ f.write("# initrd %sinitrd-version.img\n" % (cfPath)) f.write("#boot=/dev/%s\n" % (grubTarget)) + nthreads = isys.acpicpus() + if nthreads == 0: + # this should probably be table driven or something... + ncpus = isys.smpAvailable() or 1 + nthreads = isys.htavailable() or 1 + ncores = isys.coresavailable() + + if ncpus == 1: # machines that have one socket + nthreads = nthreads; + else: # machines with more than one socket + nthreads = (int(nthreads / ncores) or 1) * ncpus + + xenkernel = 0 + if os.path.exists("/proc/xen/capabilities"): + xenkernel = 1 + # get the default image to boot... we have to walk and find it # since grub indexes by where it is in the config file if defaultDev == rootDev: - default = 0 + for kernel in range(0, len(kernelList)): + default=kernel + version=kernelList[kernel][2] + if version.find('xen') >= 0: + if xenkernel: + break + elif version.find('smp') >= 0: + if not xenkernel and nthreads > 1: + break + else: + break else: # if the default isn't linux, it's the first thing in the # chain list