diff --git a/Makefile b/Makefile index 128d5994..4ae5f1d8 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,8 @@ all: src/pylorax/version.py install: all $(PYTHON) setup.py install --root=$(DESTDIR) mkdir -p $(DESTDIR)/$(mandir)/man1 - install -m 644 docs/lorax.1 $(DESTDIR)/$(mandir)/man1 - install -m 644 docs/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1 + install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1 + install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1 check: @echo "*** Running pylint ***" diff --git a/docs/conf.py b/docs/conf.py index 84acc2f1..48016339 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -243,8 +243,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'Lorax', u'Lorax Documentation', - [u'Anaconda Team'], 1) + ('lorax', 'lorax', u'Lorax Documentation', [u'Anaconda Team'], 1), + ('livemedia-creator', 'livemedia-creator', u'Live Media Creator Documentation', [u'Anaconda Team'], 1) ] # If true, show URL addresses after external links. diff --git a/docs/livemedia-creator.1 b/docs/livemedia-creator.1 deleted file mode 100644 index 800174e7..00000000 --- a/docs/livemedia-creator.1 +++ /dev/null @@ -1,251 +0,0 @@ -.TH LIVEMEDIA-CREATOR 1 2014\-04\-03 -.SH NAME -livemedia-creator \- Create live install media - -.SH SYNOPSIS -livemedia-creator [-h] - (--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami | --make-tar | --make-pxe-live | --make-ostree-live) - [--iso ISO] [--iso-only] [--disk-image DISK_IMAGE] - [--fs-image FS_IMAGE] [--ks KS] - [--image-name IMAGE_NAME] [--image-only] - [--fs-label FS_LABEL] - [--image-type IMAGE_TYPE] [--qemu-arg QEMU_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] - [--logfile LOGFILE] - [--lorax-templates LORAX_TEMPLATES] [--tmp TMP] - [--resultdir RESULT_DIR] [--app-name APP_NAME] - [--app-template APP_TEMPLATE] [--app-file APP_FILE] - [--ram MEMORY] [--vcpus VCPUS] [--vnc VNC] - [--arch ARCH] [--kernel-args KERNEL_ARGS] - [--dracut-arg DRACUT_ARGS] [--title TITLE] - [--project PROJECT] [--releasever RELEASEVER] - [--volid VOLID] [--squashfs_args SQUASHFS_ARGS] - [--timeout TIMEOUT] - -.SH DESCRIPTION -livemedia-creator uses Anaconda, kickstart and Lorax to create bootable media -that use the same install path as a normal system install. It can be used to -make live isos, bootable (partitioned) disk images and filesystem images for -use with virtualization. - -The general idea is to use virt-install to install into a disk image and then -use the disk image to create the bootable media. - -livemedia-creator --help will describe all of the options available. To create a -bootable iso you need at least: - ---make-iso to create a final bootable .iso ---iso to specify the Anaconda install media to use with virt-install ---ks is the kickstart to use to install the system - - -.SH OPTIONAL ARGUMENTS: -.TP -\fB\-h, \-\-help\fR -show this help message and exit - -.TP -\fB\-\-make\-iso\fR -Build a live iso - -.TP -\fB\-\-make\-disk\fR -Build a partitioned disk image - -.TP -\fB\-\-make\-fsimage\fR -Build a filesystem image - -.TP -\fB\-\-make\-appliance\fR -Build an appliance image and XML description - -.TP -\fB\-\-make\-ami\fR -Build an ami image - -.TP -\fB\-\-make\-tar\fR -Build a tar of the root filesystem. Defaults to root.tar.xz - -.TP -\fB\-\-make\-pxe\-live\fR -Build a live pxe boot squashfs image - -.TP -\fB\-\-make\-ostree\-live\fR -Build a live pxe boot squashfs image of Atomic Host - -.TP -\fB\-\-iso ISO\fR -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 --iso-name to rename the boot.iso - -.TP -\fB\-\-disk\-image DISK_IMAGE\fR -Path to disk image to use for creating final image - -.TP -\fB\-\-fs\-image FS_IMAGE\fR -Path to existing filesystem image to use for creating final image. - -.TP -\fB\-\-image-type IMAGE_TYPE\fR -Create a qemu-img image instead of raw sparse image when making disk images. See qemu-img --help for a list of supported types. - -.TP -\fB\-\-qemu\-arg\fR -Arguments to pass to qemu-img. Pass once for each argument - -.TP -\fB\-\-compress\fR -Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default. - -.TP -\fB\-\-compress\-arg\fR -Arguments to pass to compression. Pass once for each argument - -.TP -\fB\-\-ks KS\fR -Kickstart file defining the install. - -.TP -\fB\-\-image\-name IMAGE_NAME\fR -Name of fs/disk image to create. Default is a random name. - -.TP -\fB\-\-fs\-label FS_LABEL\fR -Label to set on fsimage, default is 'Anaconda' - -.TP -\fB\-\-image\-only\fR -Exit after creating fs/disk image. - -.TP -\fB\-\-keep\-image\fR -Keep raw disk image after .iso creation - -.TP -\fB\-\-no\-virt\fR -Use Anaconda's image install instead of virt-install - -.TP -\fB\-\-proxy PROXY\fR -proxy URL to use for the install - -.TP -\fB\-\-anaconda\-arg ANACONDA_ARGS\fR -Additional argument to pass to anaconda (no-virt mode). Pass once for eachargument - -.TP -\fB\-\-armplatform ARMPLATFORM\fR -the platform to use when creating images for ARM, i.e., highbank, mvebu, omap,tegra, etc. - -.TP -\fB\-\-location LOCATION\fR -location of iso directory tree with initrd.img and vmlinuz. Used to run virt-install with a newer initrd than the iso. - -.TP -\fB\-\-logfile LOGFILE\fR -Path to logfile - -.TP -\fB\-\-lorax\-templates LORAX_TEMPLATES\fR -Path to mako templates for lorax - -.TP -\fB\-\-tmp TMP\fR -Top level temporary directory - -.TP -\fB\-\-resultdir RESULT_DIR\fR -Directory to copy the resulting images and iso into. Defaults to the temporaryworking directory - -.TP -\fB\-\-title TITLE\fR -Substituted for @TITLE@ in bootloader config files - -.TP -\fB\-\-project PROJECT\fR -substituted for @PROJECT@ in bootloader config files - -.TP -\fB\-\-releasever RELEASEVER\fR -substituted for @VERSION@ in bootloader config files - -.TP -\fB\-\-volid VOLID\fR -volume id - -.TP -\fB\-\-squashfs_args SQUASHFS_ARGS\fR -additional squashfs args - -.TP -\fB\-\-timeout TIMEOUT\fR -Cancel installer after X minutes - -.SH APPLIANCE ARGUMENTS: -.TP -\fB\-\-app\-name APP_NAME\fR -Name of appliance to pass to template - -.TP -\fB\-\-app\-template APP_TEMPLATE\fR -Path to template to use for appliance data. - -.TP -\fB\-\-app\-file APP_FILE\fR -Appliance template results file. - -.SH PXE\-LIVE ARGUMENTS: -.TP -\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 -Memory to allocate for installer in megabytes. - -.TP -\fB\-\-vcpus VCPUS\fR -Passed to --vcpus command - -.TP -\fB\-\-vnc VNC\fR -Passed to qemu -display command. eg. vnc=127.0.0.1:5, default is to choose the first unused vnc port. - -.TP -\fB\-\-arch ARCH\fR -Passed to --arch command - -.TP -\fB\-\-kernel\-args KERNEL_ARGS\fR -Additional argument to pass to the installation kernel - -.SH DRACUT ARGUMENTS: -.TP -\fB\-\-dracut\-arg DRACUT_ARGS\fR -Argument to pass to dracut when rebuilding the initramfs. Pass this once foreach argument. NOTE: this overrides the default. - -.SH "SEE ALSO" -Documentation in /usr/share/doc/lorax/README.livemedia-creator - -.SH AUTHOR -.nf -Brian C. Lane -.fi - diff --git a/docs/livemedia-creator.rst b/docs/livemedia-creator.rst index eedc98a1..83d27646 100644 --- a/docs/livemedia-creator.rst +++ b/docs/livemedia-creator.rst @@ -39,8 +39,11 @@ Conventions used in this document: ``image`` is the disk image being created by running livemedia-creator +livemedia-creator cmdline arguments +----------------------------------- + .. argparse:: - :ref: livemedia-creator.get_parser + :ref: pylorax.cmdline.lmc_parser :prog: livemedia-creator diff --git a/docs/lorax.1 b/docs/lorax.1 deleted file mode 100644 index e341b493..00000000 --- a/docs/lorax.1 +++ /dev/null @@ -1,94 +0,0 @@ -.TH LORAX 1 2013\-07\-26 -.SH NAME -lorax \- Create installer boot iso - -.SH SYNOPSIS -lorax -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR - -.SH DESCRIPTION - -lorax is used to create the installer boot iso. - -.SH OPTIONS - -.TP -\fB\-h, \-\-help\fR -show this help message and exit - -.TP -\fB\-V\fR -show program's version number and exit - -.SH REQUIRED ARGUMENTS: - -.TP -\fB\-p STRING, \-\-product=STRING\fR -product name - -.TP -\fB\-v STRING, \-\-version=STRING\fR -version identifier - -.TP -\fB\-r STRING, \-\-release=STRING\fR -release information - -.TP -\fB\-s REPOSITORY, \-\-source=REPOSITORY\fR -source repository (may be listed multiple times) - -.SH -OPTIONAL ARGUMENTS: - -.TP -\fB\-m REPOSITORY, \-\-mirrorlist=REPOSITORY\fR -mirrorlist repository (may be listed multiple times) - -.TP -\fB\-t STRING, \-\-variant=STRING\fR -variant name - -.TP -\fB\-b URL, \-\-bugurl=URL\fR -bug reporting URL for the product - -.TP -\fB\-\-isfinal\fR - -.TP -\fB\-c STRING, \-\-config=STRING\fR -config file - -.TP -\fB\-\-proxy=STRING\fR -repo proxy url:port - -.TP -\fB\-e STRING, \-\-excludepkgs=STRING\fR -package glob to exclude (may be listed multiple times) - -.TP -\fB\-\-buildarch=STRING\fR -build architecture - -.TP -\fB\-\-volid=STRING\fR -volume id - -.TP -\fB\-\-nomacboot\fR - -.TP -\fB\-\-logfile=LOGFILE\fR -Path to logfile - -.TP -\fB\-\-tmp=TMP\fR -Top level temporary directory - -.SH AUTHORS -.nf -Martin Gracik -Will Woods -Brian C. Lane -.fi diff --git a/docs/lorax.rst b/docs/lorax.rst index b76e9733..dabc9528 100644 --- a/docs/lorax.rst +++ b/docs/lorax.rst @@ -16,8 +16,11 @@ rawhide version to build the boot.iso for rawhide, along with the rawhide repositories. +lorax cmdline arguments +----------------------- + .. argparse:: - :ref: lorax.get_parser + :ref: pylorax.cmdline.lorax_parser :prog: lorax diff --git a/docs/man/livemedia-creator.1 b/docs/man/livemedia-creator.1 new file mode 100644 index 00000000..ca3d071a --- /dev/null +++ b/docs/man/livemedia-creator.1 @@ -0,0 +1,1020 @@ +.\" Man page generated from reStructuredText. +. +.TH "LIVEMEDIA-CREATOR" "1" "March 18, 2016" "25.2" "Lorax" +.SH NAME +livemedia-creator \- Live Media Creator Documentation +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.INDENT 0.0 +.TP +.B Authors +Brian C. Lane <\fI\%bcl@redhat.com\fP> +.UNINDENT +.sp +livemedia\-creator uses \fI\%Anaconda\fP, +\fI\%kickstart\fP and \fI\%Lorax\fP to create bootable media that use the +same install path as a normal system installation. It can be used to make live +isos, bootable (partitioned) disk images, tarfiles, and filesystem images for +use with virtualization and container solutions like libvirt, docker, and +OpenStack. +.sp +The general idea is to use qemu with kickstart and an Anaconda boot.iso to +install into a disk image and then use the disk image to create the bootable +media. +.sp +livemedia\-creator \-\-help will describe all of the options available. At the +minimum you need: +.sp +\fB\-\-make\-iso\fP to create a final bootable .iso or one of the other \fB\-\-make\-*\fP options. +.sp +\fB\-\-iso\fP to specify the Anaconda install media to use with qemu. +.sp +\fB\-\-ks\fP to select the kickstart file describing what to install. +.sp +To use livemedia\-creator with virtualization you will need to have qemu installed. +.sp +If you are going to be using Anaconda directly, with \fB\-\-no\-virt\fP mode, make sure +you have the anaconda\-tui package installed. +.sp +Conventions used in this document: +.sp +\fBlmc\fP is an abbreviation for livemedia\-creator. +.sp +\fBbuilder\fP is the system where livemedia\-creator is being run +.sp +\fBimage\fP is the disk image being created by running livemedia\-creator +.SH LIVEMEDIA-CREATOR CMDLINE ARGUMENTS +.sp +Create Live Install Media + +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +usage: livemedia\-creator [\-h] + (\-\-make\-iso | \-\-make\-disk | \-\-make\-fsimage | \-\-make\-appliance | \-\-make\-ami | \-\-make\-tar | \-\-make\-pxe\-live | \-\-make\-ostree\-live | \-\-make\-oci | \-\-make\-vagrant) + [\-\-iso ISO] [\-\-iso\-only] [\-\-iso\-name ISO_NAME] + [\-\-ks KS] [\-\-image\-only] [\-\-no\-virt] [\-\-proxy PROXY] + [\-\-anaconda\-arg ANACONDA_ARGS] + [\-\-armplatform ARMPLATFORM] [\-\-location LOCATION] + [\-\-logfile LOGFILE] + [\-\-lorax\-templates LORAX_TEMPLATES] [\-\-tmp TMP] + [\-\-resultdir RESULT_DIR] [\-\-macboot] [\-\-nomacboot] + [\-\-disk\-image DISK_IMAGE] [\-\-keep\-image] + [\-\-fs\-image FS_IMAGE] [\-\-image\-name IMAGE_NAME] + [\-\-fs\-label FS_LABEL] [\-\-image\-type IMAGE_TYPE] + [\-\-qemu\-arg QEMU_ARGS] [\-\-qcow2] + [\-\-qcow2\-arg QEMU_ARGS] [\-\-compression COMPRESSION] + [\-\-compress\-arg COMPRESS_ARGS] [\-\-app\-name APP_NAME] + [\-\-app\-template APP_TEMPLATE] [\-\-app\-file APP_FILE] + [\-\-ram MEMORY] [\-\-vcpus VCPUS] [\-\-vnc VNC] + [\-\-arch ARCH] [\-\-kernel\-args KERNEL_ARGS] + [\-\-ovmf\-path OVMF_PATH] [\-\-virt\-uefi] [\-\-no\-kvm] + [\-\-dracut\-arg DRACUT_ARGS] + [\-\-live\-rootfs\-size LIVE_ROOTFS_SIZE] + [\-\-live\-rootfs\-keep\-size] [\-\-oci\-config OCI_CONFIG] + [\-\-oci\-runtime OCI_RUNTIME] + [\-\-vagrant\-metadata VAGRANT_METADATA] + [\-\-vagrantfile VAGRANTFILE] [\-\-title TITLE] + [\-\-project PROJECT] [\-\-releasever RELEASEVER] + [\-\-volid VOLID] [\-\-squashfs_args SQUASHFS_ARGS] + [\-\-timeout TIMEOUT] +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B Options: +.INDENT 7.0 +.TP +.B \-\-make\-iso=False +Build a live iso +.TP +.B \-\-make\-disk=False +Build a partitioned disk image +.TP +.B \-\-make\-fsimage=False +Build a filesystem image +.TP +.B \-\-make\-appliance=False +Build an appliance image and XML description +.TP +.B \-\-make\-ami=False +Build an ami image +.TP +.B \-\-make\-tar=False +Build a tar of the root filesystem +.TP +.B \-\-make\-pxe\-live=False +Build a live pxe boot squashfs image +.TP +.B \-\-make\-ostree\-live=False +Build a live pxe boot squashfs image of Atomic Host +.TP +.B \-\-make\-oci=False +Build an Open Container Initiative image +.TP +.B \-\-make\-vagrant=False +Build a Vagrant Box image +.TP +.B \-\-iso +Anaconda installation .iso path to use for qemu +.TP +.B \-\-iso\-only=False +Remove all iso creation artifacts except the boot.iso, combine with \-\-iso\-name to rename the boot.iso +.TP +.B \-\-iso\-name +Name of output iso file for \-\-iso\-only. Default is boot.iso +.TP +.B \-\-ks +Kickstart file defining the install. +.TP +.B \-\-image\-only=False +Exit after creating fs/disk image. +.TP +.B \-\-no\-virt=False +Run anaconda directly on host instead of using qemu +.TP +.B \-\-proxy +proxy URL to use for the install +.TP +.B \-\-anaconda\-arg +Additional argument to pass to anaconda (no\-virt mode). Pass once for each argument +.TP +.B \-\-armplatform +the platform to use when creating images for ARM, i.e., highbank, mvebu, omap, tegra, etc. +.TP +.B \-\-location +location of iso directory tree with initrd.img and vmlinuz. Used to run qemu with a newer initrd than the iso. +.TP +.B \-\-logfile=./livemedia.log +Name and path for primary logfile, other logs will be created in the same directory. +.TP +.B \-\-lorax\-templates +Path to mako templates for lorax +.TP +.B \-\-tmp=/var/tmp +Top level temporary directory +.TP +.B \-\-resultdir +Directory to copy the resulting images and iso into. Defaults to the temporary working directory +.TP +.B \-\-macboot=True +Undocumented +.TP +.B \-\-nomacboot=True +Undocumented +.TP +.B \-\-disk\-image +Path to existing disk image to use for creating final image. +.TP +.B \-\-keep\-image=False +Keep raw disk image after .iso creation +.TP +.B \-\-fs\-image +Path to existing filesystem image to use for creating final image. +.TP +.B \-\-image\-name +Name of output file to create. Used for tar, fs and disk image. Default is a random name. +.TP +.B \-\-fs\-label=Anaconda +Label to set on fsimage, default is \(aqAnaconda\(aq +.TP +.B \-\-image\-type +Create an image with qemu\-img. See qemu\-img \-\-help for supported formats. +.TP +.B \-\-qemu\-arg=[] +Arguments to pass to qemu\-img. Pass once for each argument, they will be used for ALL calls to qemu\-img. +.TP +.B \-\-qcow2=False +Create qcow2 image instead of raw sparse image when making disk images. +.TP +.B \-\-qcow2\-arg=[] +Arguments to pass to qemu\-img. Pass once for each argument, they will be used for ALL calls to qemu\-img. +.TP +.B \-\-compression=xz +Compression binary for make\-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default. +.TP +.B \-\-compress\-arg=[] +Arguments to pass to compression. Pass once for each argument +.TP +.B \-\-app\-name +Name of appliance to pass to template +.TP +.B \-\-app\-template +Path to template to use for appliance data. +.TP +.B \-\-app\-file=appliance.xml +Appliance template results file. +.TP +.B \-\-ram=1024 +Memory to allocate for installer in megabytes. +.TP +.B \-\-vcpus +Passed to qemu \-smp command +.TP +.B \-\-vnc +Passed to qemu \-display command. eg. vnc=127.0.0.1:5, default is to choose the first unused vnc port. +.TP +.B \-\-arch +System arch to build for. Used to select qemu\-system\-* command. Defaults to qemu\-system\- +.TP +.B \-\-kernel\-args +Additional argument to pass to the installation kernel +.TP +.B \-\-ovmf\-path=/usr/share/OVMF/ +Path to OVMF firmware +.TP +.B \-\-virt\-uefi=False +Use OVMF firmware to boot the VM in UEFI mode +.TP +.B \-\-no\-kvm=False +Skip using kvm with qemu even if it is available. +.TP +.B \-\-dracut\-arg +Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument. NOTE: this overrides the default. (default: ) +.TP +.B \-\-live\-rootfs\-size=0 +Size of root filesystem of live image in GiB +.TP +.B \-\-live\-rootfs\-keep\-size=False +Keep the original size of root filesystem in live image +.TP +.B \-\-oci\-config +config.json OCI configuration file +.TP +.B \-\-oci\-runtime +runtime.json OCI configuration file +.TP +.B \-\-vagrant\-metadata +optional metadata.json file +.TP +.B \-\-vagrantfile +optional vagrantfile +.TP +.B \-\-title=Linux Live Media +Substituted for @TITLE@ in bootloader config files +.TP +.B \-\-project=Linux +substituted for @PROJECT@ in bootloader config files +.TP +.B \-\-releasever=25 +substituted for @VERSION@ in bootloader config files +.TP +.B \-\-volid +volume id +.TP +.B \-\-squashfs_args +additional squashfs args +.TP +.B \-\-timeout +Cancel installer after X minutes +.UNINDENT +.UNINDENT +.SH QUICKSTART +.sp +Run this to create a bootable live iso: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +sudo livemedia\-creator \-\-make\-iso \e +\-\-iso=/extra/iso/boot.iso \-\-ks=./docs/fedora\-livemedia.ks +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +You can run it directly from the lorax git repo like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia\-creator \e +\-\-make\-iso \-\-iso=/extra/iso/boot.iso \e +\-\-ks=./docs/fedora\-livemedia.ks \-\-lorax\-templates=./share/ +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +You can observe the installation using vnc. The logs will show what port was +chosen, or you can use a specific port by passing it. eg. \fB\-\-vnc vnc:127.0.0.1:5\fP +.sp +This is usually a good idea when testing changes to the kickstart. lmc tries +to monitor the logs for fatal errors, but may not catch everything. +.SH HOW ISO CREATION WORKS +.sp +There are 2 stages, the install stage which produces a disk or filesystem image +as its output, and the boot media creation which uses the image as its input. +Normally you would run both stages, but it is possible to stop after the +install stage, by using \fB\-\-image\-only\fP, or to skip the install stage and use +a previously created disk image by passing \fB\-\-disk\-image\fP or \fB\-\-fs\-image\fP +.sp +When creating an iso qemu boots using the passed Anaconda installer iso +and installs the system based on the kickstart. The \fB%post\fP section of the +kickstart is used to customize the installed system in the same way that +current spin\-kickstarts do. +.sp +livemedia\-creator monitors the install process for problems by watching the +install logs. They are written to the current directory or to the base +directory specified by the \-\-logfile command. You can also monitor the install +by using a vnc client. This is recommended when first modifying a kickstart, +since there are still places where Anaconda may get stuck without the log +monitor catching it. +.sp +The output from this process is a partitioned disk image. kpartx can be used +to mount and examine it when there is a problem with the install. It can also +be booted using kvm. +.sp +When creating an iso the disk image\(aqs / partition is copied into a formatted +filesystem image which is then used as the input to lorax for creation of the +final media. +.sp +The final image is created by lorax, using the templates in /usr/share/lorax/live/ +or the live directory below the directory specified by \fB\-\-lorax\-templates\fP\&. The +templates are written using the Mako template system with some extra commands +added by lorax. +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +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 \fB\-\-iso\-only\fP and the other files will be removed. You +can also name the iso by using \fB\-\-iso\-name my\-live.iso\fP\&. +.UNINDENT +.UNINDENT +.SH KICKSTARTS +.sp +The docs/ directory includes several example kickstarts, one to create a live +desktop iso using GNOME, and another to create a minimal disk image. When +creating your own kickstarts you should start with the minimal example, it +includes several needed packages that are not always included by dependencies. +.sp +Or you can use existing spin kickstarts to create live media with a few +changes. Here are the steps I used to convert the Fedora XFCE spin. +.INDENT 0.0 +.IP 1. 4 +Flatten the xfce kickstart using ksflatten +.IP 2. 4 +Add zerombr so you don\(aqt get the disk init dialog +.IP 3. 4 +Add clearpart \-\-all +.IP 4. 4 +Add swap partition +.IP 5. 4 +bootloader target +.IP 6. 4 +Add shutdown to the kickstart +.IP 7. 4 +Add network \-\-bootproto=dhcp \-\-activate to activate the network +This works for F16 builds but for F15 and before you need to pass +something on the cmdline that activate the network, like sshd: +.INDENT 4.0 +.INDENT 3.5 +\fBlivemedia\-creator \-\-kernel\-args="sshd"\fP +.UNINDENT +.UNINDENT +.IP 8. 4 +Add a root password: +.INDENT 4.0 +.INDENT 3.5 +.sp +.nf +.ft C +rootpw rootme +network \-\-bootproto=dhcp \-\-activate +zerombr +clearpart \-\-all +bootloader \-\-location=mbr +part swap \-\-size=512 +shutdown +.ft P +.fi +.UNINDENT +.UNINDENT +.IP 9. 4 +In the livesys script section of the %post remove the root password. This +really depends on how the spin wants to work. You could add the live user +that you create to the %wheel group so that sudo works if you wanted to. +.INDENT 4.0 +.INDENT 3.5 +\fBpasswd \-d root > /dev/null\fP +.UNINDENT +.UNINDENT +.IP 10. 4 +Remove /etc/fstab in %post, dracut handles mounting the rootfs +.sp +\fBcat /dev/null > /dev/fstab\fP +.sp +Do this only for live iso\(aqs, the filesystem will be mounted read only if +there is no /etc/fstab +.IP 11. 4 +Don\(aqt delete initramfs files from /boot in %post +.IP 12. 4 +When creating live iso\(aqs you need to have, at least, these packages in the %package section:: +dracut\-config\-generic +dracut\-live +\-dracut\-config\-rescue +grub\-efi +memtest86+ +syslinux +.UNINDENT +.sp +One drawback to using qemu is that it pulls the packages from the repo each +time you run it. To speed things up you either need a local mirror of the +packages, or you can use a caching proxy. When using a proxy you pass it to +livemedia\-creator like this: +.INDENT 0.0 +.INDENT 3.5 +\fB\-\-proxy=http://proxy.yourdomain.com:3128\fP +.UNINDENT +.UNINDENT +.sp +You also need to use a specific mirror instead of mirrormanager so that the +packages will get cached, so your kickstart url would look like: +.INDENT 0.0 +.INDENT 3.5 +\fBurl \-\-url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"\fP +.UNINDENT +.UNINDENT +.sp +You can also add an update repo, but don\(aqt name it updates. Add \-\-proxy to it +as well. +.SH ANACONDA IMAGE INSTALL (NO-VIRT) +.sp +You can create images without using qemu by passing \fB\-\-no\-virt\fP on the +cmdline. This will use Anaconda\(aqs directory install feature to handle the +install. There are a couple of things to keep in mind when doing this: +.INDENT 0.0 +.IP 1. 3 +It will be most reliable when building images for the same release that the +host is running. Because Anaconda has expectations about the system it is +running under you may encounter strange bugs if you try to build newer or +older releases. +.IP 2. 3 +Make sure selinux is set to permissive or disabled. It won\(aqt install +correctly with selinux set to enforcing yet. +.IP 3. 3 +It may totally trash your host. So far I haven\(aqt had this happen, but the +possibility exists that a bug in Anaconda could result in it operating on +real devices. I recommend running it in a virt or on a system that you can +afford to lose all data from. +.UNINDENT +.sp +The logs from anaconda will be placed in an ./anaconda/ directory in either +the current directory or in the directory used for \-\-logfile +.sp +Example cmdline: +.sp +\fBsudo livemedia\-creator \-\-make\-iso \-\-no\-virt \-\-ks=./fedora\-livemedia.ks\fP +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Using no\-virt to create a partitioned disk image (eg. \-\-make\-disk or +\-\-make\-vagrant) will only create disks usable on the host platform (BIOS +or UEFI). You can create BIOS partitioned disk images on UEFI by using +virt. +.UNINDENT +.UNINDENT +.SH AMI IMAGES +.sp +Amazon EC2 images can be created by using the \-\-make\-ami switch and an appropriate +kickstart file. All of the work to customize the image is handled by the kickstart. +The example currently included was modified from the cloud\-kickstarts version so +that it would work with livemedia\-creator. +.sp +Example cmdline: +.sp +\fBsudo livemedia\-creator \-\-make\-ami \-\-iso=/path/to/boot.iso \-\-ks=./docs/fedora\-livemedia\-ec2.ks\fP +.sp +This will produce an ami\-root.img file in the working directory. +.sp +At this time I have not tested the image with EC2. Feedback would be welcome. +.SH APPLIANCE CREATION +.sp +livemedia\-creator can now replace appliance\-tools by using the \-\-make\-appliance +switch. This will create the partitioned disk image and an XML file that can be +used with virt\-image to setup a virtual system. +.sp +The XML is generated using the Mako template from +/usr/share/lorax/appliance/libvirt.xml You can use a different template by +passing \fB\-\-app\-template