Add --live-rootfs-keep-size option

This commit is contained in:
Radek Vykydal 2015-01-15 11:26:44 +01:00
parent d16bdcaf6d
commit 5aa6bb5f0c
2 changed files with 12 additions and 1 deletions

View File

@ -12,6 +12,7 @@ livemedia-creator [-h]
[--qcow2] [--qcow2-arg QCOW2_ARGS] [--qcow2] [--qcow2-arg QCOW2_ARGS]
[--compression] [--compress-arg] [--compression] [--compress-arg]
[--live-rootfs-size LIVE_ROOTFS_SIZE] [--live-rootfs-size LIVE_ROOTFS_SIZE]
[--live-rootfs-keep-size LIVE_ROOTFS_KEEP_SIZE]
[--keep-image] [--no-virt] [--proxy PROXY] [--keep-image] [--no-virt] [--proxy PROXY]
[--anaconda-arg ANACONDA_ARGS] [--anaconda-arg ANACONDA_ARGS]
[--armplatform ARMPLATFORM] [--location LOCATION] [--armplatform ARMPLATFORM] [--location LOCATION]
@ -201,6 +202,10 @@ Appliance template results file.
\fB\-\-live\-rootfs\-size\fR \fB\-\-live\-rootfs\-size\fR
Size of root filesystem of live image in GiB. By default approximate size of space used in root filesystem is used. Size of root filesystem of live image in GiB. By default approximate size of space used in root filesystem is used.
.TP
\fB\-\-live\-rootfs\-keep\-size\fR
Keep the size of original root filesystem (rounded down to GiB) in live image
.SH VIRT\-INSTALL ARGUMENTS: .SH VIRT\-INSTALL ARGUMENTS:
.TP .TP
\fB\-\-ram MEMORY\fR \fB\-\-ram MEMORY\fR

View File

@ -1239,6 +1239,9 @@ def main():
pxelive_group = parser.add_argument_group("pxe to live arguments") pxelive_group = parser.add_argument_group("pxe to live arguments")
pxelive_group.add_argument("--live-rootfs-size", type=int, default=0, pxelive_group.add_argument("--live-rootfs-size", type=int, default=0,
help="Size of root filesystem of live image in GiB") help="Size of root filesystem of live image in GiB")
pxelive_group.add_argument("--live-rootfs-keep-size", action="store_true",
help="Keep the original size of root filesystem in live image")
parser.add_argument("--title", default="Linux Live Media", parser.add_argument("--title", default="Linux Live Media",
help="Substituted for @TITLE@ in bootloader config files") help="Substituted for @TITLE@ in bootloader config files")
@ -1446,7 +1449,10 @@ def main():
mounted_sysroot_boot_dir = None mounted_sysroot_boot_dir = None
if opts.ostree: if opts.ostree:
mounted_sysroot_boot_dir = mount_boot_part_over_root(img_mount) mounted_sysroot_boot_dir = mount_boot_part_over_root(img_mount)
size = opts.live_rootfs_size or None if opts.live_rootfs_keep_size:
size = img_mount.mount_size / 1024**3
else:
size = opts.live_rootfs_size or None
result_dir = make_live_images(opts, work_dir, img_mount.mount_dir, size=size) result_dir = make_live_images(opts, work_dir, img_mount.mount_dir, size=size)
finally: finally:
if mounted_sysroot_boot_dir: if mounted_sysroot_boot_dir: