From b138b27bd8ab6ceb426ea40c1be0faa671f543df Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 11 Jan 2016 09:54:40 -0800 Subject: [PATCH] Add --iso-name to use with --iso-only Instead of reusing --image-name add a new argument to name the iso. This way the disk image can be given a unique name with --image-name and the iso can be named something different. --- docs/livemedia-creator.1 | 2 +- docs/livemedia-creator.rst | 2 +- src/sbin/livemedia-creator | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/livemedia-creator.1 b/docs/livemedia-creator.1 index 45b448a5..4dfb5c01 100644 --- a/docs/livemedia-creator.1 +++ b/docs/livemedia-creator.1 @@ -87,7 +87,7 @@ Anaconda installation .iso path to use for virt-install .TP \fB\-\-iso-only\fR -Remove all iso creation artifacts except the boot.iso, combine with --image-name to rename the boot.iso +Remove all iso creation artifacts except the boot.iso, combine with --iso-name to rename the boot.iso .TP \fB\-\-disk\-image DISK_IMAGE\fR diff --git a/docs/livemedia-creator.rst b/docs/livemedia-creator.rst index fe1bd17e..bb31ee7b 100644 --- a/docs/livemedia-creator.rst +++ b/docs/livemedia-creator.rst @@ -105,7 +105,7 @@ written using the Mako template system which is very flexible. The output from --make-iso includes the artifacts used to create the boot.iso; the kernel, initrd, the squashfs filesystem, etc. If you only want the boot.iso you can pass ``--iso-only`` and the other files will be removed. You - can also name the iso by using ``--image-name my-live.iso``. + can also name the iso by using ``--iso-name my-live.iso``. Kickstarts diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 7c441a35..2ac33a12 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -1054,7 +1054,9 @@ def main(): help="Anaconda installation .iso path to use for virt-install") parser.add_argument("--iso-only", action="store_true", help="Remove all iso creation artifacts except the boot.iso, " - "combine with --image-name to rename the boot.iso") + "combine with --iso-name to rename the boot.iso") + parser.add_argument("--iso-name", default=None, + help="Name of output iso file for --iso-only. Default is boot.iso") parser.add_argument("--ks", action="append", type=os.path.abspath, help="Kickstart file defining the install.") parser.add_argument("--image-only", action="store_true", @@ -1402,7 +1404,7 @@ def main(): log.error("%s is missing, skipping --iso-only.", boot_iso) else: iso_dir = tempfile.mkdtemp(prefix="lmc-result-") - dest_file = joinpaths(iso_dir, opts.image_name or "boot.iso") + dest_file = joinpaths(iso_dir, opts.iso_name or "boot.iso") shutil.move(boot_iso, dest_file) shutil.rmtree(result_dir) result_dir = iso_dir