From: Richard W.M. Jones Date: Sat, 4 Apr 2015 19:35:33 +0000 (+0100) Subject: docs: Add documentation for template files. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=2876765436d2f1c1e89d5e7326d9b5812ad5eb00;p=mclu.git docs: Add documentation for template files. --- diff --git a/mclu.pod b/mclu.pod index 081d233..51d216e 100644 --- a/mclu.pod +++ b/mclu.pod @@ -48,9 +48,6 @@ Display version number and exit. =back - - - =head1 SUBCOMMANDS =over 4 @@ -172,8 +169,112 @@ Open the graphical console of the guest (using L). =head1 TEMPLATE FILES +Template files are shell scripts which the C program calls to +perform various operations. + +Template files must have the extension C<.template>, must be +executable (C), and they must live in the +template directory (usually found through the C<$MCLU_PATH> +environment variable). + +Several template files are supplied with mclu sources, and it's a good +idea to consult those for examples and when creating your own +templates. + +C runs the template with a single parameter in order to "query" +the template. All templates must support the C parameter, +which is used to test that the file is a template: + + $ ./templates/rawhide.template probe + hello + +Templates should exit with code 2 if they don't know about a parameter: + + $ ./templates/rawhide.template unknown + $ echo $? + 2 + +The current parameters are: + +=over 4 + +=item base-image + +The template MUST print the name of the image that it builds. The +meaning of this generally follows the conventions of +L, if virt-builder is used by the template. + +=item build + +The template MUST build a disk image. Because the C