From 6e2fdfe23f0e1bde98fa34bf146fb5782e50ebfc Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 24 May 2012 15:55:46 -0700 Subject: [PATCH] livemedia-creator: Add appliance creation This adds support for creating an appliance description file for the disk image. Mako templates are used to make it easy to support other appliance targets. The included example works with virt-image. --- README.livemedia-creator | 68 +++++++++++------- lorax.spec | 1 + share/appliance/libvirt.tmpl | 35 +++++++++ src/sbin/livemedia-creator | 136 ++++++++++++++++++++++++++++++----- 4 files changed, 197 insertions(+), 43 deletions(-) create mode 100644 share/appliance/libvirt.tmpl diff --git a/README.livemedia-creator b/README.livemedia-creator index 630f6399..76ae1e0e 100644 --- a/README.livemedia-creator +++ b/README.livemedia-creator @@ -24,7 +24,7 @@ If you are using the lorax git repo you can run it like so: sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \ --make-iso --iso=/extra/iso/Fedora-16-x86_64-netinst.iso \ ---ks=./docs/livemedia-example.ks --lorax-templates=./share/ +--ks=./docs/fedora-livemedia.ks --lorax-templates=./share/ If you want to watch the install you can pass '--vnc vnc' and use a vnc client to connect to localhost:0 @@ -35,8 +35,7 @@ to monitor the logs for fatal errors, but may not catch everything. HOW IT WORKS ------------ -The --make-* switches define the final output. Currently only --make-iso -and --make-disk are working. +The --make-* switches define the final output. You then need to either pass --iso and --ks in order to create a disk image using virt-install, or --disk-image to use a disk image from a previous run @@ -48,19 +47,19 @@ customize the installed system in the same way that current spin-kickstarts do. 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 passing ---vnc vnc and 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. +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 passing --vnc vnc and 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. 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. -Once the disk image is created it copies the / partition into a formatted -disk image which is then used as the input to lorax for creation of the -final media. +When creating an iso the disk image's / partition is copied into a formatted +disk image which is then used as the input to lorax for creation of the final +media. The final image is created by lorax, using the templates in /usr/share/lorax/ or the directory specified by --lorax-templates @@ -169,6 +168,38 @@ This will produce an ami-root.img file in the working directory. At this time I have not tested the image with EC2. Feedback would we welcome. +APPLIANCE CREATION ------------------ 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. + +The XML is generated using the Mako template from +/usr/share/lorax/appliance/virt-image.xml You can use a different template by +passing --app-template