guestfs-tools/0005-Update-common-submodule.patch
Richard W.M. Jones cb5c7d1bef Fix pnputils after virt-customize --inject-virtio-win
resolves: RHEL-116537
2025-09-22 18:01:50 +01:00

123 lines
3.4 KiB
Diff

From a01095308d22a5ab4d5858dfe0ee46f0b1bec28c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 20 Aug 2025 10:34:24 +0100
Subject: [PATCH] Update common submodule
Pulls in this fix which should have no effect:
Richard W.M. Jones (1):
mlcustomize/firstboot.ml: Use quoted string literals for firstboot
(cherry picked from virt-v2v commit b7aadeac02ef326d542cd83e441b5a9d99ced793)
(cherry picked from commit 038b30fb08107487cdba4bc0dbabb33dbf75f4c3)
---
common | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Submodule common 89f1eb2d3..7ecf3992b:
diff --git a/common/mlcustomize/firstboot.ml b/common/mlcustomize/firstboot.ml
index 5f2642b06..360c33d67 100644
--- a/common/mlcustomize/firstboot.ml
+++ b/common/mlcustomize/firstboot.ml
@@ -35,8 +35,7 @@ let sanitize_name =
module Linux = struct
let firstboot_dir = "/usr/lib/virt-sysprep"
- let firstboot_sh = sprintf "\
-#!/bin/sh -
+ let firstboot_sh = sprintf {|#!/bin/sh -
### BEGIN INIT INFO
# Provides: virt-sysprep
@@ -57,14 +56,14 @@ d=%s/scripts
d_done=%s/scripts-done
logfile=~root/virt-sysprep-firstboot.log
-echo \"$0\" \"$@\" 2>&1 | tee -a $logfile
-echo \"Scripts dir: $d\" 2>&1 | tee -a $logfile
+echo "$0" "$@" 2>&1 | tee -a $logfile
+echo "Scripts dir: $d" 2>&1 | tee -a $logfile
-if test \"$1\" = \"start\"
+if test "$1" = "start"
then
mkdir -p $d_done
for f in $d/* ; do
- if test -x \"$f\"
+ if test -x "$f"
then
# move the script to the 'scripts-done' directory, so it is not
# executed again at the next boot
@@ -75,7 +74,7 @@ then
done
rm -f $d_done/*
fi
-" firstboot_dir firstboot_dir
+|} firstboot_dir firstboot_dir
let systemd_target = "multi-user.target"
@@ -282,38 +281,37 @@ module Windows = struct
* XXX It would be better to use powershell here. For some ideas see
* https://github.com/HCK-CI/HLK-Setup-Scripts/
*)
- let firstboot_script = sprintf "\
-@echo off
+ let firstboot_script = sprintf {|@echo off
setlocal EnableDelayedExpansion
set firstboot=%s
-set log=%%firstboot%%\\log.txt
+set log=%%firstboot%%\log.txt
-set scripts=%%firstboot%%\\scripts
-set scripts_done=%%firstboot%%\\scripts-done
+set scripts=%%firstboot%%\scripts
+set scripts_done=%%firstboot%%\scripts-done
-call :main >> \"%%log%%\" 2>&1
+call :main >> "%%log%%" 2>&1
exit /b
:main
echo starting firstboot service
-if not exist \"%%scripts_done%%\" (
- mkdir \"%%scripts_done%%\"
+if not exist "%%scripts_done%%" (
+ mkdir "%%scripts_done%%"
)
:: Pick the next script to run.
-for %%%%f in (\"%%scripts%%\"\\*.bat) do (
- echo running \"%%%%f\"
- pushd \"%%scripts%%\"
- call \"%%%%~nf\"
+for %%%%f in ("%%scripts%%"\*.bat) do (
+ echo running "%%%%f"
+ pushd "%%scripts%%"
+ call "%%%%~nf"
set elvl=!errorlevel!
echo .... exit code !elvl!
popd
if !elvl! NEQ 249 (
echo Script succeeded, moving to scripts-done
- move \"%%%%f\" \"%%scripts_done%%\"
+ move "%%%%f" "%%scripts_done%%"
) else (
echo Script failed, will retry on next boot
)
@@ -329,8 +327,8 @@ for %%%%f in (\"%%scripts%%\"\\*.bat) do (
:: Fallthrough here if there are no scripts.
echo uninstalling firstboot service
-\"%%firstboot%%\\%s\" -s firstboot uninstall
-" firstboot_dir_win srvany in
+"%%firstboot%%\%s" -s firstboot uninstall
+|} firstboot_dir_win srvany in
g#write (firstboot_dir // "firstboot.bat")
(String.unix2dos firstboot_script);