livemedia-creator: no-virt fsimage should only use / size from ks

The amount of free space for / should be consistent between installation
types, otherwise some may have enough space, and others won't.
This commit is contained in:
Brian C. Lane 2015-08-26 15:54:44 -07:00
parent 9da9bf954d
commit 394d37fbb5

View File

@ -791,7 +791,12 @@ def make_image(opts, ks):
Use virt-install or anaconda to install to a disk image.
"""
disk_size = 2 + sum(p.size for p in ks.handler.partition.partitions)
# Disk size for a filesystem image should only be the size of /
# to prevent surprises when using the same kickstart for different installations.
if opts.no_virt and (opts.make_iso or opts.make_fsimage):
disk_size = 2 + sum(p.size for p in ks.handler.partition.partitions if p.mountpoint == "/")
else:
disk_size = 2 + sum(p.size for p in ks.handler.partition.partitions)
log.info("disk_size = %sMiB", disk_size)
if opts.image_name: