1 |
diff -Nur -x '*.orig' -x '*.rej' booty-0.44.4/bootloaderInfo.py mezzanine_patched_booty-0.44.4/bootloaderInfo.py |
2 |
--- booty-0.44.4/bootloaderInfo.py 2007-05-17 22:25:24.000000000 -0600 |
3 |
+++ mezzanine_patched_booty-0.44.4/bootloaderInfo.py 2007-05-17 22:23:04.000000000 -0600 |
4 |
@@ -727,10 +727,36 @@ |
5 |
f.write("# initrd %sinitrd-version.img\n" % (cfPath)) |
6 |
f.write("#boot=/dev/%s\n" % (grubTarget)) |
7 |
|
8 |
+ nthreads = isys.acpicpus() |
9 |
+ if nthreads == 0: |
10 |
+ # this should probably be table driven or something... |
11 |
+ ncpus = isys.smpAvailable() or 1 |
12 |
+ nthreads = isys.htavailable() or 1 |
13 |
+ ncores = isys.coresavailable() |
14 |
+ |
15 |
+ if ncpus == 1: # machines that have one socket |
16 |
+ nthreads = nthreads; |
17 |
+ else: # machines with more than one socket |
18 |
+ nthreads = (int(nthreads / ncores) or 1) * ncpus |
19 |
+ |
20 |
+ xenkernel = 0 |
21 |
+ if os.path.exists("/proc/xen"): |
22 |
+ xenkernel = 1 |
23 |
+ |
24 |
# get the default image to boot... we have to walk and find it |
25 |
# since grub indexes by where it is in the config file |
26 |
if defaultDev == rootDev: |
27 |
- default = 0 |
28 |
+ for kernel in range(0, len(kernelList)): |
29 |
+ default=kernel |
30 |
+ version=kernelList[kernel][2] |
31 |
+ if version.find('xen') >= 0: |
32 |
+ if xenkernel: |
33 |
+ break |
34 |
+ elif version.find('smp') >= 0: |
35 |
+ if not xenkernel and nthreads > 1: |
36 |
+ break |
37 |
+ else: |
38 |
+ break |
39 |
else: |
40 |
# if the default isn't linux, it's the first thing in the |
41 |
# chain list |