Blame SOURCES/0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch

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