From ed3bec702e704f698e48696aee4fdc978d33258d 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 Resolves: rhbz#1184021 --- 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 97b72bf7..060bb972 100644 --- a/docs/livemedia-creator.1 +++ b/docs/livemedia-creator.1 @@ -11,6 +11,7 @@ livemedia-creator [-h] [--fs-label FS_LABEL] [--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] @@ -197,6 +198,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 87166edd..51ed4ccb 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -1075,6 +1075,9 @@ if __name__ == '__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" ) @@ -1276,7 +1279,10 @@ if __name__ == '__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: