File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ let run ~cancelled ?stdin ~log t config result_tmp =
102102 Os. exec (ssh @ [" doas" ; " fsck" ; " -y" ; dev]) >> = fun () ->
103103 Os. exec (ssh @ [" doas" ; " mount" ; dev; dst])
104104 | Windows ->
105- Os. exec (ssh @ [" cmd" ; " /c" ; " rmdir /s /q '" ^ dst ^ " '" ]) >> = fun () ->
105+ Os. exec (ssh @ [" cmd" ; " /c" ; " if exist ' " ^ dst ^ " ' rmdir /s /q '" ^ dst ^ " '" ]) >> = fun () ->
106106 let drive_letter = String. init 1 (fun _ -> Char. chr (Char. code 'd' + i)) in
107107 Os. exec (ssh @ [" cmd" ; " /c" ; " mklink /j '" ^ dst ^ " ' '" ^ drive_letter ^ " :\\ '" ])
108108 ) config.Config. mounts >> = fun () ->
@@ -126,6 +126,16 @@ let run ~cancelled ?stdin ~log t config result_tmp =
126126 Os. process_result ~pp proc2 >> = fun res ->
127127 copy_log >> = fun () ->
128128
129+ Lwt_list. iter_s (fun { Config.Mount. dst; _ } ->
130+ match t.qemu_guest_os with
131+ | Linux
132+ | OpenBSD -> Lwt. return_unit
133+ | Windows ->
134+ (* if the junction isn't removed and the target drive is missing, then `mkdir -p <dst>/foo` fails *)
135+ (* also note that `fsutil reparsepoint delete <dst>` only works if the target exists *)
136+ Os. exec (ssh @ [" cmd" ; " /c" ; " rmdir '" ^ dst ^ " '" ])
137+ ) config.Config. mounts >> = fun () ->
138+
129139 (match t.qemu_guest_arch with
130140 | Amd64 ->
131141 Log. info (fun f -> f " Sending QEMU an ACPI shutdown event" );
Original file line number Diff line number Diff line change 248248 </SynchronousCommand>
249249 <SynchronousCommand wcm:action="add">
250250 <Order>20</Order>
251- <CommandLine>netsh advfirewall firewall set rule group ="OpenSSH SSH Server Preview (sshd)" new profile=any enable=yes</CommandLine>
251+ <CommandLine>netsh advfirewall firewall set rule name ="OpenSSH SSH Server Preview (sshd)" new profile=any enable=yes</CommandLine>
252252 <Description>Configure OpenSSH</Description>
253253 </SynchronousCommand>
254254 <SynchronousCommand wcm:action="add">
You can’t perform that action at this time.
0 commit comments