[lorax 3/3] Add --noupgrade option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/pylorax/__init__.py |   29 +++++++++++++++--------------
 src/sbin/lorax          |    5 ++++-
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index 95f912f..00db2c2 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -135,7 +135,7 @@ class Lorax(BaseLoraxClass):
 
     def run(self, ybo, product, version, release, variant="", bugurl="",
             isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None,
-            domacboot=True, remove_temp=False):
+            domacboot=True, doupgrade=True, remove_temp=False):
 
         assert self._configured
 
@@ -283,19 +283,20 @@ class Lorax(BaseLoraxClass):
         anaconda_args = dracut_args + ["--add", "anaconda pollcdrom"]
         treebuilder.rebuild_initrds(add_args=anaconda_args)
 
-        # Build upgrade.img. It'd be nice if these could coexist in the same
-        # image, but that would increase the size of the anaconda initramfs,
-        # which worries some people (esp. PPC tftpboot). So they're separate.
-        try:
-            # If possible, use the 'fedup' plymouth theme
-            themes = runcmd_output(['plymouth-set-default-theme', '--list'],
-                                   root=installroot)
-            if 'fedup' in themes.splitlines():
-                os.environ['PLYMOUTH_THEME_NAME'] = 'fedup'
-        except RuntimeError:
-            pass
-        upgrade_args = dracut_args + ["--add", "system-upgrade"]
-        treebuilder.rebuild_initrds(add_args=upgrade_args, prefix="upgrade")
+        if doupgrade:
+            # Build upgrade.img. It'd be nice if these could coexist in the same
+            # image, but that would increase the size of the anaconda initramfs,
+            # which worries some people (esp. PPC tftpboot). So they're separate.
+            try:
+                # If possible, use the 'fedup' plymouth theme
+                themes = runcmd_output(['plymouth-set-default-theme', '--list'],
+                                       root=installroot)
+                if 'fedup' in themes.splitlines():
+                    os.environ['PLYMOUTH_THEME_NAME'] = 'fedup'
+            except RuntimeError:
+                pass
+            upgrade_args = dracut_args + ["--add", "system-upgrade"]
+            treebuilder.rebuild_initrds(add_args=upgrade_args, prefix="upgrade")
 
         logger.info("populating output tree and building boot images")
         treebuilder.build()
diff --git a/src/sbin/lorax b/src/sbin/lorax
index f3aa9c3..2a66cd3 100755
--- a/src/sbin/lorax
+++ b/src/sbin/lorax
@@ -107,6 +107,8 @@ def main(args):
             help="volume id", metavar="STRING")
     optional.add_option("--nomacboot", help="",
             action="store_false", default=True, dest="domacboot")
+    optional.add_option("--noupgrade", help="",
+            action="store_false", default=True, dest="doupgrade")
     optional.add_option("--logfile", default="./lorax.log",
             help="Path to logfile")
     optional.add_option("--tmp", default="/var/tmp",
@@ -169,7 +171,8 @@ def main(args):
     lorax.run(yb, opts.product, opts.version, opts.release,
               opts.variant, opts.bugurl, opts.isfinal,
               workdir=tempdir, outputdir=outputdir, buildarch=opts.buildarch,
-              volid=opts.volid, domacboot=opts.domacboot, remove_temp=True)
+              volid=opts.volid, domacboot=opts.domacboot, doupgrade=opts.doupgrade,
+              remove_temp=True)
 
 
 def get_yum_base_object(installroot, repositories, mirrorlists=[],
-- 
1.7.9.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux