[PATCH 2/3] Add extlinux command-line option.

mattdm at fedoraproject.org mattdm at fedoraproject.org
Tue May 7 15:59:33 UTC 2013


From: Matthew Miller <mattdm at mattdm.org>

Note that there's no attempt to validate that this will work for your platform
or anything; it assumes that if you ask for it, you want to try.
---
 anaconda                 | 4 ++++
 pyanaconda/bootloader.py | 5 ++++-
 pyanaconda/flags.py      | 4 ++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/anaconda b/anaconda
index 57065f9..4bfc273 100755
--- a/anaconda
+++ b/anaconda
@@ -285,6 +285,7 @@ def parseOptions(argv=None, cmdline=None):
     op.add_option("--nomemcheck", action="store_false", dest="memcheck")
     op.add_option("--leavebootorder", action="store_true", default=False)
     op.add_option("--noeject", action="store_false", dest="eject", default=True)
+    op.add_option("--extlinux", action="store_true", default=False)
 
     # some defaults change based on cmdline flags
     if cmdline is not None:
@@ -823,6 +824,9 @@ if __name__ == "__main__":
     if opts.armPlatform:
         flags.armPlatform = opts.armPlatform
 
+    if opts.extlinux:
+        flags.extlinux = opts.extlinux
+
     # set flags
     flags.dmraid = opts.dmraid
     flags.mpath = opts.mpath
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 3ee32cb..9ada0a1 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -2215,7 +2215,10 @@ bootloader_by_platform = {platform.X86: GRUB2,
 
 def get_bootloader():
     platform_name = platform.platform.__class__.__name__
-    cls = bootloader_by_platform.get(platform.platform.__class__, BootLoader)
+    if flags.extlinux:
+        cls = EXTLINUX
+    else:
+        cls = bootloader_by_platform.get(platform.platform.__class__, BootLoader)
     log.info("bootloader %s on %s platform" % (cls.__name__, platform_name))
     return cls()
 
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index 5ba291c..7a22c90 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -66,6 +66,7 @@ class Flags(object):
         self.dirInstall = False
         self.askmethod = False
         self.eject = True
+        self.extlinux = False
         self.gpt = False
         self.leavebootorder = False
         self.testing = False
@@ -88,6 +89,9 @@ class Flags(object):
         if not selinux.is_selinux_enabled():
             self.selinux = 0
 
+        if "extlinux" in self.cmdline:
+            self.extlinux = True
+
         if "gpt" in self.cmdline:
             self.gpt = True
 
-- 
1.8.2.1



More information about the anaconda-patches mailing list