=back
+=item cmdline
+
+The template MAY print a kernel command line. This is used to boot
+the guest, but only when C<needs-external-kernel> is set (see below).
+
=item disk-bus
The template MAY print the disk type supported by this guest. Possible
" remote_external_kernel remote_external_initrd
else "" in
+ let xml = xml ^
+ match template_info.Template.cmdline with
+ | Some cmdline -> sprintf " <cmdline>%s</cmdline>\n" cmdline
+ | None -> "" in
+
let xml = xml ^ "\
</os>
<features>
network_model : string option;
has_xml_target : bool;
needs_external_kernel : bool;
+ cmdline : string option;
}
let probe ?(verbose = false) filename =
| Some ["1"|"yes"] -> true
| Some _ -> false in
+ let cmdline =
+ match run_template ~verbose filename "cmdline" [] with
+ | Some [cmdline] -> Some cmdline
+ | _ -> None in
+
+ if not needs_external_kernel && cmdline <> None then (
+ eprintf "mclu: template cannot set 'cmdline' unless 'needs-external-kernel' is 'yes'.\n";
+ exit 1
+ );
+
{ base_image = base_image;
guest_arch = guest_arch;
minimum_memory = minimum_memory;
disk_bus = disk_bus;
network_model = network_model;
has_xml_target = has_xml_target;
- needs_external_kernel = needs_external_kernel; }
+ needs_external_kernel = needs_external_kernel;
+ cmdline = cmdline }
network_model : string option;
has_xml_target : bool;
needs_external_kernel : bool;
+ cmdline : string option;
}
val probe : ?verbose:bool -> string -> template_info