[f23-branch 1/1] strip spaces from extlinux label and default (#ticket)

bcl installerbot-noreply at redhat.com
Thu Nov 12 00:52:25 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

Spaces are not allowed, if other kernels are added it will always select
the first one, not the one indicated by the default entry.
---
 pyanaconda/bootloader.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index f8ed2c1..d97f4be 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2243,12 +2243,15 @@ def write_config_images(self, config):
                 args.update(["rootflags=subvol=%s" % image.device.name])
             args.update(self.boot_args)
             log.info("bootloader.py: used boot args: %s ", args)
-            stanza = ("label %(label)s (%(version)s)\n"
+
+            # extlinux labels cannot have spaces
+            label = "%s(%s)" % (self.image_label(image), image.version)
+            label = label.replace(" ", "")
+            stanza = ("label %(label)s\n"
                       "\tkernel %(boot_prefix)s/%(kernel)s\n"
                       "\tinitrd %(boot_prefix)s/%(initrd)s\n"
                       "\tappend %(args)s\n\n"
-                      % {"label": self.image_label(image),
-                         "version": image.version,
+                      % {"label": label,
                          "kernel": image.kernel,
                          "initrd": image.initrd,
                          "args": args,
@@ -2266,7 +2269,7 @@ def write_config_header(self, config):
                   % {"productName": productName, "timeout": self.timeout *10})
         config.write(header)
         if self.default is not None:
-            config.write("default %(default)s\n\n" % {"default" : self.image_label(self.default)})
+            config.write("default %(default)s\n\n" % {"default" : self.image_label(self.default).replace(" ", "")})
         self.write_config_password(config)
 
     def write_config_password(self, config):


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/9ac8a62a5a6870d5a720c73efe7da6c4e507c0aa


More information about the anaconda-patches mailing list