[PATCH 1/4] add command line option to set the platform.

Dennis Gilmore dennis at ausil.us
Wed Aug 1 07:42:03 UTC 2012


Use case is to create images using livemedia-creator where we wont be
running on the target platform, this could be for a arm system, or
could be used to make efi bootable media on a non efi system, or any
other use case where we need to override anacondas detection of the
running system.

Signed-off-by: Dennis Gilmore <dennis at ausil.us>
---
 anaconda            | 4 ++++
 pyanaconda/flags.py | 1 +
 pyanaconda/iutil.py | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/anaconda b/anaconda
index fc679c9..c37dd72 100755
--- a/anaconda
+++ b/anaconda
@@ -222,6 +222,7 @@ def parseOptions(argv=None, cmdline=None):
     op.add_option("--kickstart", dest="ksfile")
     op.add_option("--rescue", dest="rescue", action="store_true", default=False)
     op.add_option("--targetarch", "rpmarch", dest="targetArch", type="string")
+    op.add_option("--targetplatform", "platform", dest="targetPlatform", type="string")
 
     op.add_option("-m", "--method", dest="method", default=None)
     op.add_option("--repo", dest="method", default=None)
@@ -803,6 +804,9 @@ if __name__ == "__main__":
     if opts.targetArch:
         flags.targetarch = opts.targetArch
 
+    if opts.targetPlatform:
+        flags.platform = opts.targetPlatform
+
     # set flags
     flags.dmraid = opts.dmraid
     flags.mpath = opts.mpath
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index 92584fd..7a18043 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -58,6 +58,7 @@ class Flags(object):
         self.targetarch = None
         self.useIPv4 = True
         self.useIPv6 = True
+        self.platform = None
         self.preexisting_x11 = False
         self.noverifyssl = False
         self.imageInstall = False
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index ed6d098..aef4cc6 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -627,6 +627,9 @@ def getARMMachine():
     if not isARM():
         return 0
 
+    if flags.platform:
+        return flags.platform
+
     armMachine = os.uname()[2].rpartition('.' )[2]
 
     if armMachine.startswith('arm'):
-- 
1.7.11.2



More information about the anaconda-patches mailing list