From b5e6c21a8241b3040c772f5ecd93a23a1896dc53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= <tgolembi@redhat.com>
Date: Wed, 5 Feb 2020 14:11:36 +0100
Subject: [PATCH] windows: small tweaks of qemu-ga firstboot script
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- match log file with script name
- restart manually only after successfull install, this also helps
debugging because we can log the installer return code
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
(cherry picked from commit 59f9ff40621240a6eed28c4425d3d69d8b21bc0e
in virt-v2v)
---
v2v/convert_windows.ml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index bdb0092c3..43c1f85de 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -430,7 +430,13 @@ popd
fun msi_path ->
let fb_script = "\
echo Installing qemu-ga from " ^ msi_path ^ "
-\"\\" ^ msi_path ^ "\" /qn /forcerestart /l+*vx \"%cd%\\qemu-ga.log\"
+\"\\" ^ msi_path ^ "\" /norestart /qn /l+*vx \"%~dpn0.log\"
+set elvl=!errorlevel!
+echo Done installing qemu-ga error_level=!elvl!
+if !elvl! == 0 (
+ echo Restarting Windows...
+ shutdown /r /f /c \"rebooted by firstboot script\"
+)
" in
Firstboot.add_firstboot_script g inspect.i_root
("install " ^ msi_path) fb_script;
--
2.26.2