15 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 |
# |
# |
17 |
|
|
18 |
|
import isys |
19 |
import os, sys |
import os, sys |
20 |
import crypt |
import crypt |
21 |
import whrandom |
import whrandom |
721 |
f.write("# initrd %sinitrd-version.img\n" % (cfPath)) |
f.write("# initrd %sinitrd-version.img\n" % (cfPath)) |
722 |
f.write("#boot=/dev/%s\n" % (grubTarget)) |
f.write("#boot=/dev/%s\n" % (grubTarget)) |
723 |
|
|
724 |
|
# Check to see if smp kernel should be default or not |
725 |
|
if isys.smpAvailable() or isys.htavailable(): |
726 |
|
smpCapable=1 |
727 |
|
else: |
728 |
|
smpCapable=0 |
729 |
|
|
730 |
# get the default image to boot... we have to walk and find it |
# get the default image to boot... we have to walk and find it |
731 |
# since grub indexes by where it is in the config file |
# since grub indexes by where it is in the config file |
732 |
if defaultDev == rootDev: |
if defaultDev == rootDev: |
733 |
default = 0 |
for kernel in range(0, len(kernelList)): |
734 |
|
default=kernel |
735 |
|
version=kernelList[kernel][2] |
736 |
|
if version.find('smp')<0 and not smpCapable: |
737 |
|
break |
738 |
|
if version.find('smp')>=0 and smpCapable: |
739 |
|
break |
740 |
else: |
else: |
741 |
# if the default isn't linux, it's the first thing in the |
# if the default isn't linux, it's the first thing in the |
742 |
# chain list |
# chain list |
893 |
if target == "partition": |
if target == "partition": |
894 |
stage1Target = self.grubbyPartitionName(gtPart) |
stage1Target = self.grubbyPartitionName(gtPart) |
895 |
|
|
896 |
cmd = "install %s%s/stage1 d %s %s/stage2 p %s%s/grub.conf" % \ |
cmd = "install %s --stage2=/boot/grub/stage2 %s%s/stage1 %s %s%s/stage2 p %s/grub.conf" % \ |
897 |
(forcelba, grubPath, stage1Target, grubPath, bPart, grubPath) |
(forcelba, bPart, grubPath, stage1Target, bPart, grubPath, grubPath) |
898 |
cmds.append(cmd) |
cmds.append(cmd) |
899 |
|
|
900 |
if not justConfigFile: |
if not justConfigFile: |
1138 |
grubbyRootPart = self.grubbyPartitionName(rootDev) |
grubbyRootPart = self.grubbyPartitionName(rootDev) |
1139 |
break |
break |
1140 |
|
|
1141 |
cmd = "root %s\ninstall %s/stage1 d %s %s/stage2 p %s%s/grub.conf" \ |
cmd = "root %s\ninstall --stage2=/boot/grub/stage2 %s%s/stage1 %s %s%s/stage2 p %s/grub.conf" \ |
1142 |
% (grubbyRootPart, grubPath, grubbyStage1Dev, |
% (grubbyRootPart, grubbyRootPart, grubPath, grubbyStage1Dev, |
1143 |
grubPath, grubbyRootPart, grubPath) |
grubbyRootPart, grubPath, grubPath) |
1144 |
|
|
1145 |
if not justConfigFile: |
if not justConfigFile: |
1146 |
log("GRUB command %s", cmd) |
log("GRUB command %s", cmd) |