From 5aa6bb5f0cf26b8823d4f830dbfaab73a64e523c Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Thu, 15 Jan 2015 11:26:44 +0100 Subject: [PATCH] Add --live-rootfs-keep-size option --- docs/livemedia-creator.1 | 5 +++++ src/sbin/livemedia-creator | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/livemedia-creator.1 b/docs/livemedia-creator.1 index 9cb578cd..550bcf47 100644 --- a/docs/livemedia-creator.1 +++ b/docs/livemedia-creator.1 @@ -12,6 +12,7 @@ livemedia-creator [-h] [--qcow2] [--qcow2-arg QCOW2_ARGS] [--compression] [--compress-arg] [--live-rootfs-size LIVE_ROOTFS_SIZE] + [--live-rootfs-keep-size LIVE_ROOTFS_KEEP_SIZE] [--keep-image] [--no-virt] [--proxy PROXY] [--anaconda-arg ANACONDA_ARGS] [--armplatform ARMPLATFORM] [--location LOCATION] @@ -201,6 +202,10 @@ Appliance template results file. \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. +.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: .TP \fB\-\-ram MEMORY\fR diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 861e97d1..fc1202c3 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -1239,6 +1239,9 @@ def main(): pxelive_group = parser.add_argument_group("pxe to live arguments") pxelive_group.add_argument("--live-rootfs-size", type=int, default=0, 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", help="Substituted for @TITLE@ in bootloader config files") @@ -1446,7 +1449,10 @@ def main(): mounted_sysroot_boot_dir = None if opts.ostree: 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) finally: if mounted_sysroot_boot_dir: