builder: template: Save the final virt-install command to a file.

For documentation purposes only.
This commit is contained in:
Richard W.M. Jones
2017-10-17 21:56:51 +01:00
parent 143d61745b
commit a52b7bdccc
2 changed files with 11 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ index_fragments = $(wildcard *.index-fragment)
EXTRA_DIST = \
$(index_fragments) \
*.ks \
*.virt-install-cmd \
debian.preseed \
make-template.ml \
ubuntu.preseed \

View File

@@ -143,6 +143,16 @@ let rec main () =
*)
print_virt_install_command stdout vi;
(* Save the virt-install command to a file, for documentation. *)
let chan = open_out (filename_of_os os arch ".virt-install-cmd") in
fprintf chan "# This is the virt-install command which was used to create\n";
fprintf chan "# the virt-builder template '%s'\n" (string_of_os os arch);
fprintf chan "# NB: This file is generated for documentation purposes ONLY!\n";
fprintf chan "# This script was never run, and is not intended to be run.\n";
fprintf chan "\n";
print_virt_install_command chan vi;
close_out chan;
(* Print the virt-install notes for OSes which cannot be automated
* fully. (These are different from the notes= section in the
* index fragment).