[PATCH 3/3] create good default statement in extlinux.conf

Gene Czarcinski gene at czarc.net
Tue Apr 22 16:33:06 UTC 2014


The information to create a good default statement is not
available in write_config_header() so move the code to
write_config_images() where is is available.
---
 pyanaconda/bootloader.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index f8d8220..276f6d6 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2202,6 +2202,7 @@ class EXTLINUX(BootLoader):
 
     def write_config_images(self, config):
         self.write_config_console(config)
+        first_time = 0
         for image in self.images:
             args = Arguments()
             args.update(["root=%s" % image.device.fstabSpec, "ro"])
@@ -2212,6 +2213,12 @@ class EXTLINUX(BootLoader):
                 args.update(["ro"])
             args.update(self.boot_args)
             log.info("bootloader.py: used boot args: %s ", args)
+            if first_time == 0:
+                first_time = 1
+                pre_stanza = ("default %(label)s (%(version)s)\n\n"
+                              % {"label": self.image_label(image),
+                                 "version": image.version})
+                config.write(pre_stanza)
             stanza = ("label %(label)s (%(version)s)\n"
                       "\tkernel %(boot_prefix)s/%(kernel)s\n"
                       "\tinitrd %(boot_prefix)s/%(initrd)s\n"
-- 
1.9.0



More information about the anaconda-patches mailing list