templates: Use shell variables to pass parameters to 'build'.
[mclu.git] / mclu_boot.ml
index 6927363..43ab049 100644 (file)
@@ -212,8 +212,11 @@ Try: `mclu on %s'\n" hostname hostname;
 " mac_addr network_model in
 
   let xml = xml ^ "\
+    <serial type='pty'>
+      <target port='0'/>
+    </serial>
     <console type='pty'>
-      <target type='virtio' port='0'/>
+      <target type='serial' port='0'/>
     </console>
     <input type='tablet' bus='usb'/>
     <input type='mouse' bus='ps2'/>
@@ -236,10 +239,19 @@ Try: `mclu on %s'\n" hostname hostname;
   );
   let cmd =
     (* XXX Don't hard-code network_bridge here. *)
-    sprintf "ssh root@%s LIBGUESTFS_BACKEND_SETTINGS=network_bridge=br0 %s build %s %s %s"
-      (quote hostname) remote_filename
-      (quote template_info.Template.base_image) (quote remote_image)
-      format in
+    sprintf "ssh root@%s \
+LIBGUESTFS_BACKEND_SETTINGS=network_bridge=br0 \
+base_image=%s \
+format=%s \
+name=%s \
+output=%s \
+%s build"
+      (quote hostname)
+      (quote template_info.Template.base_image) (* base_image *)
+      format (* format *)
+      name (* name *)
+      (quote remote_image) (* output *)
+      remote_filename in
   if verbose then printf "%s\n%!" cmd;
   if Sys.command cmd <> 0 then (
     eprintf "mclu: remote build failed\n";