[LORAX 3/6] Allow a None to be passed as size to create_runtime

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

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

This is so that imgutils.mkext4img can dynamically calculate the size of
the image.
---
 src/pylorax/treebuilder.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index b1b5b0c..2dda313 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -130,7 +130,10 @@ class RuntimeBuilder(object):
     def create_runtime(self, outfile="/tmp/squashfs.img", compression="xz", compressargs=[], size=2):
         # make live rootfs image - must be named "LiveOS/rootfs.img" for dracut
         workdir = joinpaths(os.path.dirname(outfile), "runtime-workdir")
-        fssize = size * (1024*1024*1024) # 2GB sparse file compresses down to nothin'
+        if size:
+            fssize = size * (1024*1024*1024) # 2GB sparse file compresses down to nothin'
+        else:
+            fssize = None       # Let mkext4img figure out the needed size
         os.makedirs(joinpaths(workdir, "LiveOS"))
         imgutils.mkext4img(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"),
                            label="Anaconda", size=fssize)
-- 
1.7.6.4

_______________________________________________
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