summaryrefslogtreecommitdiffstats
path: root/bootloader.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-08-21 21:07:09 +0000
committerJeremy Katz <katzj@redhat.com>2001-08-21 21:07:09 +0000
commited398a707d2d9c353d9661792fc328e5c3df662f (patch)
treeb6ae66207deeaa211ed6a7fc6c356ecbb21acc36 /bootloader.py
parent2d8ec25e52db90b6854c97c7a37c7341397db7e0 (diff)
downloadanaconda-ed398a707d2d9c353d9661792fc328e5c3df662f.tar.gz
anaconda-ed398a707d2d9c353d9661792fc328e5c3df662f.tar.xz
anaconda-ed398a707d2d9c353d9661792fc328e5c3df662f.zip
fix-up so we only write out config files if there are any kernels being
installed and if not, we should pop up a warning telling the user that we're not changing the configuration (52099)
Diffstat (limited to 'bootloader.py')
-rw-r--r--bootloader.py45
1 files changed, 33 insertions, 12 deletions
diff --git a/bootloader.py b/bootloader.py
index 9891ecad1..24d9539da 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -263,14 +263,25 @@ class bootloaderInfo:
return lilo
def write(self, instRoot, fsset, bl, langs, kernelList, chainList,
- defaultDev, justConfig):
-
- config = self.getBootloaderConfig(instRoot, fsset, bl, langs,
- kernelList, chainList, defaultDev)
- config.write(instRoot + self.configfile, perms = self.perms)
+ defaultDev, justConfig, intf):
+ if len(kernelList) >= 1:
+ config = self.getBootloaderConfig(instRoot, fsset, bl, langs,
+ kernelList, chainList,
+ defaultDev)
+ config.write(instRoot + self.configfile, perms = self.perms)
+ else:
+ self.noKernelsWarn(intf)
return ""
+ # XXX in the future we also should do some validation on the config
+ # file that's already there
+ def noKernelsWarn(self, intf):
+ intf.messageWindow(_("Warning"),
+ _("No kernel packages were installed on your "
+ "system. Your boot loader configuration "
+ "will not be changed."))
+
def getArgList(self):
args = []
@@ -336,9 +347,12 @@ class ia64BootloaderInfo(bootloaderInfo):
return ""
def write(self, instRoot, fsset, bl, langs, kernelList, chainList,
- defaultDev, justConfig):
- str = self.writeLilo(instRoot, fsset, bl, langs, kernelList,
- chainList, defaultDev, justConfig)
+ defaultDev, justConfig, intf):
+ if len(kernelList) >= 1:
+ str = self.writeLilo(instRoot, fsset, bl, langs, kernelList,
+ chainList, defaultDev, justConfig)
+ else:
+ self.noKernelsWarn(intf)
bootdev = fsset.getEntryByMountPoint("/boot/efi").device.getDevice()
if not bootdev:
@@ -402,6 +416,9 @@ class x86BootloaderInfo(bootloaderInfo):
def writeGrub(self, instRoot, fsset, bl, langs, kernelList, chainList,
defaultDev, justConfigFile):
+ if len(kernelList) < 1:
+ return ""
+
images = bl.images.getImages()
rootDev = fsset.getEntryByMountPoint("/").device.getDevice()
@@ -595,9 +612,10 @@ class x86BootloaderInfo(bootloaderInfo):
def writeLilo(self, instRoot, fsset, bl, langs, kernelList,
chainList, defaultDev, justConfig):
- config = self.getBootloaderConfig(instRoot, fsset, bl, langs,
+ if len(kernelList) >= 1:
+ config = self.getBootloaderConfig(instRoot, fsset, bl, langs,
kernelList, chainList, defaultDev)
- config.write(instRoot + self.configfile, perms = self.perms)
+ config.write(instRoot + self.configfile, perms = self.perms)
if not justConfig:
# throw away stdout, catch stderr
@@ -610,7 +628,10 @@ class x86BootloaderInfo(bootloaderInfo):
return str
def write(self, instRoot, fsset, bl, langs, kernelList, chainList,
- defaultDev, justConfig):
+ defaultDev, justConfig, intf):
+ if len(kernelList) < 1:
+ self.noKernelsWarn(intf)
+
str = self.writeLilo(instRoot, fsset, bl, langs, kernelList,
chainList, defaultDev,
justConfig | (self.useGrubVal))
@@ -740,7 +761,7 @@ def writeBootloader(intf, instRoot, fsset, bl, langs, comps):
bl.write(instRoot, fsset, bl, langs, kernelList, otherList, defaultDev,
- justConfigFile)
+ justConfigFile, intf)
w.pop()