Skip to content

Commit

Permalink
Add --iso-name to use with --iso-only
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bcl committed Jan 11, 2016
1 parent d941e0d commit b138b27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/livemedia-creator.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/livemedia-creator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/sbin/livemedia-creator
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b138b27

Please sign in to comment.