mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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