On 03/08/22 17:19, Richard W.M. Jones wrote:
On Tue, Mar 08, 2022 at 03:30:59PM +0100, Laszlo Ersek wrote:
The windows converter installs the firstboot scripts in this order:
do_convert configure_firstboot configure_wait_pnp add_firstboot_script configure_vmdp add_firstboot_script configure_qemu_ga add_firstboot_script unconfigure_xenpv add_firstboot_script unconfigure_prltools add_firstboot_script unconfigure_vmwaretools add_firstboot_script configure_network_interfaces install_firstboot_powershell "v2vnetcf.ps1" add_firstboot_script -> the script that polls for "netkvm.sys" with Get-NetAdapter, then calls New-NetIPAddress
Because of this, if the guest is supposed to have static IP address(es), they are set by the "v2vnetcf.ps1" firstboot script quite late during first boot.
It's more comfortable for users if the network is usable from an earlier point of the first boot, so register "v2vnetcf.ps1" in priority group 2500 (the default is 5000), moving the script to the front.
Suggested-by: Richard W.M. Jones <rjones@redhat.com> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- convert/convert_windows.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml index fa2eae28a768..b53312a9aba4 100644 --- a/convert/convert_windows.ml +++ b/convert/convert_windows.ml @@ -739,8 +739,12 @@ let convert (g : G.guestfs) _ inspect _ static_ips = add "" ) static_ips;
- (* Install the Powershell script to run at firstboot. *) - Windows.install_firstboot_powershell g inspect psh_filename !psh + (* Install the Powershell script to run at firstboot. + * + * Place it first among the firstboot scripts (RHBZ#1788823). + *) + Windows.install_firstboot_powershell g inspect ~prio:2500 psh_filename + !psh ) (* static_ips <> [] *)
ACK
Rich.
Merged the series as commit range 3a66d0fece08..5d24c1575750, with the following updates: 1: 570d94a81870 ! 1: bb952c113cf1 convert_linux: wrap overlong lines @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-2-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml --- a/convert/convert_linux.ml 2: fee83d7a0d6a ! 2: fb909fe761c4 convert_windows: wrap overlong lines @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-3-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 3: ee99a22b1b68 ! 3: e2995d10a5ee convert_linux: align shell script indentation with OCaml source code @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-4-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml --- a/convert/convert_linux.ml 4: 991624de3934 ! 4: 597d17756723 convert_windows: rewrite "configure_qemu_ga" script purely in PowerShell @@ -15,6 +15,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-5-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 5: 918d2cc869ea ! 5: 295b8ae74e33 convert_windows: align "reg_restore" batch file commands with OCaml source @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-6-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 6: 0f216c4351e3 ! 6: 423a009280b6 convert_windows: align "configure_wait_pnp" batch file with OCaml source @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-7-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 7: 74e1089a3774 ! 7: 1a63125af21d convert_windows: align "configure_vmdp" batch files with OCaml source @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-8-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 8: ad69b2cc19c5 ! 8: 4e4959037294 convert_windows: align "unconfigure_xenpv" batch file with OCaml source @@ -4,6 +4,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-9-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 9: 7b0004c90c6d ! 9: e3814222190c convert_windows: align "unconfigure_prltools" batch file with OCaml source @@ -7,6 +7,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-10-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 10: b2bdea6dcfab ! 10: 12648416c15d convert_windows: align "unconfigure_vmwaretools" batch file with OCaml src @@ -7,6 +7,8 @@ Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-11-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml 11: 981546f9f33c ! 11: 54b74413e86d convert/windows: expose "prio" parameter in install_firstboot_powershell @@ -4,11 +4,16 @@ 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. + around "Firstboot.add_firstboot_script", enable callers of the former to + set the script run priority. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-12-lersek@redhat.com> + [lersek@redhat.com: improve commit message language (Rich)] + [lersek@redhat.com: include hunk for submodule update (Rich)] + [lersek@redhat.com: forward optional parameter idiomatically (Rich)] + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/windows.mli b/convert/windows.mli --- a/convert/windows.mli @@ -33,8 +38,7 @@ *) let install_firstboot_powershell g { Types.i_windows_systemroot; i_root } - filename code = -+ ?(prio = Firstboot.default_prio) filename -+ code = ++ ?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 @@ -43,4 +47,11 @@ 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 ++ Firstboot.add_firstboot_script g i_root ?prio filename fb + +diff --git a/common b/common +--- a/common ++++ b/common +@@ +-Subproject commit 60efc5407552c12688a5e99b7a54d23d5990aa8f ++Subproject commit ab708d11d832457d2a0c74e7a6d8c219a4fdd90f 12: 6117bd7cfc15 ! 12: 5d24c1575750 convert_windows: install "v2vnetcf.ps1" with prio 2500 @@ -35,6 +35,8 @@ Suggested-by: Richard W.M. Jones <rjones@redhat.com> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1788823 Signed-off-by: Laszlo Ersek <lersek@redhat.com> + Message-Id: <20220308143059.6384-13-lersek@redhat.com> + Acked-by: Richard W.M. Jones <rjones@redhat.com> diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml --- a/convert/convert_windows.ml Thanks Laszlo