summaryrefslogtreecommitdiffstats
path: root/bootloader.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-08-01 19:17:33 +0000
committerJeremy Katz <katzj@redhat.com>2001-08-01 19:17:33 +0000
commitf6901efa95939f5585f54c33b7ea0c8d3005793f (patch)
treedc69cdf733606aeb45ff23953404545fd0076937 /bootloader.py
parentc53c8c00d6b566ca7705a234974805b594a31a84 (diff)
downloadanaconda-f6901efa95939f5585f54c33b7ea0c8d3005793f.tar.gz
anaconda-f6901efa95939f5585f54c33b7ea0c8d3005793f.tar.xz
anaconda-f6901efa95939f5585f54c33b7ea0c8d3005793f.zip
set bootloader default properly for grub (50249)
Diffstat (limited to 'bootloader.py')
-rw-r--r--bootloader.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/bootloader.py b/bootloader.py
index 7c075b7c6..9237dae13 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -407,7 +407,23 @@ class x86BootloaderInfo(bootloaderInfo):
bootDev = bootDev.device.getDevice(asBoot = 1)
- f.write('default=0\n')
+ # 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
+ else:
+ i = 0
+ for (label, longlabel, version) in kernelList:
+ i = i + 1
+ for (label, longlabel, device) in chainList:
+ if ((not longlabel) or (longlabel == "")):
+ continue
+ if defaultDev == device:
+ default = i
+ break
+ i = i + 1
+
+ f.write('default=%s\n' % (default))
f.write('timeout=10\n')
f.write('splashimage=%s%sgrub/splash.xpm.gz\n'
% (grubbyPartitionName(bootDev), cfPath))