summaryrefslogtreecommitdiffstats
path: root/bootloader.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-08-13 23:58:16 +0000
committerJeremy Katz <katzj@redhat.com>2001-08-13 23:58:16 +0000
commit9a8b42fc2c45ddf984a4e25d543b003373d4129c (patch)
treef50f434138abff387fdb3362cce720d4fe6176a2 /bootloader.py
parenta9953cdeb57a2f8011c9d38656771e942038fb15 (diff)
downloadanaconda-9a8b42fc2c45ddf984a4e25d543b003373d4129c.tar.gz
anaconda-9a8b42fc2c45ddf984a4e25d543b003373d4129c.tar.xz
anaconda-9a8b42fc2c45ddf984a4e25d543b003373d4129c.zip
remove stale efi entries (50779)
Diffstat (limited to 'bootloader.py')
-rw-r--r--bootloader.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/bootloader.py b/bootloader.py
index 175b560f2..bd9f10898 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -301,6 +301,32 @@ class bootloaderInfo:
self.above1024 = 0
class ia64BootloaderInfo(bootloaderInfo):
+ # XXX wouldn't it be nice to have a real interface to use efibootmgr from?
+ def removeOldEfiEntries(self, instRoot):
+ p = os.pipe()
+ iutil.execWithRedirect('/usr/sbin/efibootmgr', ["efibootmgr"],
+ root = instRoot, stdout = p[1])
+ os.close(p[1])
+
+ c = os.read(p[0], 1)
+ buf = c
+ while (c):
+ c = os.read(p[0], 1)
+ buf = buf + c
+ os.close(p[0])
+ lines = string.split(buf, '\n')
+ for line in lines:
+ fields = string.split(line)
+ if len(fields) < 4:
+ continue
+ if fields[1:4] == ["Red","Hat","Linux"]:
+ entry = fields[0][4:8]
+ iutil.execWithRedirect('/usr/sbin/efibootmgr',
+ ["efibootmgr", "-b", entry, "-B"],
+ root = instRoot,
+ stdout="/dev/tty5", stderr="/dev/tty5")
+
+
def writeLilo(self, instRoot, fsset, bl, langs, kernelList,
chainList, defaultDev, justConfig):
config = self.getBootloaderConfig(instRoot, fsset, bl, langs,
@@ -329,6 +355,8 @@ class ia64BootloaderInfo(bootloaderInfo):
bootpart = bootdev[ind:]
if bootdisk[0:4] == "ida/" or bootdisk[0:6] == "cciss/" or bootdisk[0:3] == "rd/":
bootdisk = bootdisk[:-1]
+
+ self.removeOldEfiEntries(instRoot)
argv = [ "/usr/sbin/efibootmgr", "-c" , "-w", "-L",
"Red Hat Linux", "-d", "/dev/%s" % bootdisk, "-p", bootpart ]