Allow a None to be passed as size to create_runtime
This is so that imgutils.mkext4img can dynamically calculate the size of the image.
This commit is contained in:
parent
035d49628c
commit
7d1b7b4cc8
@ -130,7 +130,10 @@ class RuntimeBuilder(object):
|
|||||||
def create_runtime(self, outfile="/tmp/squashfs.img", compression="xz", compressargs=[], size=2):
|
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
|
# make live rootfs image - must be named "LiveOS/rootfs.img" for dracut
|
||||||
workdir = joinpaths(os.path.dirname(outfile), "runtime-workdir")
|
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"))
|
os.makedirs(joinpaths(workdir, "LiveOS"))
|
||||||
imgutils.mkext4img(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"),
|
imgutils.mkext4img(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"),
|
||||||
label="Anaconda", size=fssize)
|
label="Anaconda", size=fssize)
|
||||||
|
Loading…
Reference in New Issue
Block a user