The "Firstboot.add_firstboot_script" function now takes an (optional)
priority parameter. Because "install_firstboot_powershell" is a wrapper
around "Firstboot.add_firstboot_script", enable callers of the former too
to set the script run priority.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1788823
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
convert/windows.mli | 6 +++---
convert/windows.ml | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/convert/windows.mli b/convert/windows.mli
index d888e2db40b3..4c7f292832ac 100644
--- a/convert/windows.mli
+++ b/convert/windows.mli
@@ -23,7 +23,7 @@ val detect_antivirus : Types.inspect -> bool
this Windows guest. *)
val install_firstboot_powershell : Guestfs.guestfs -> Types.inspect ->
- string -> string list -> unit
-(** [install_powershell_firstboot g inspect filename code] installs a
+ ?prio:int -> string -> string list -> unit
+(** [install_powershell_firstboot g inspect prio filename code] installs a
Powershell script (the lines of code) as a firstboot script in
- the Windows VM. *)
+ the Windows VM. If [prio] is omitted, [Firstboot.default_prio] is used. *)
diff --git a/convert/windows.ml b/convert/windows.ml
index fc0faef57249..8a30be10d21a 100644
--- a/convert/windows.ml
+++ b/convert/windows.ml
@@ -52,7 +52,8 @@ and (=~) str rex = PCRE.matches rex str
* a regular batch file.
*)
let install_firstboot_powershell g { Types.i_windows_systemroot; i_root }
- filename code =
+ ?(prio = Firstboot.default_prio) filename
+ code =
let tempdir = sprintf "%s/Temp" i_windows_systemroot in
g#mkdir_p tempdir;
let code = String.concat "\r\n" code ^ "\r\n" in
@@ -67,4 +68,4 @@ let install_firstboot_powershell g { Types.i_windows_systemroot; i_root
}
let ps_path = i_windows_systemroot ^ "\\Temp\\" ^ filename in
let fb = sprintf "%s -ExecutionPolicy ByPass -file %s" ps_exe ps_path in
- Firstboot.add_firstboot_script g i_root filename fb
+ Firstboot.add_firstboot_script g i_root ~prio filename fb
--
2.19.1.3.g30247aa5d201