From 5eebd819d38de95b848802652977378422f88102 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 5 Dec 2022 09:51:09 +0000 Subject: [PATCH] Copy drivers for Windows 11, Windows 2019 & Windows 2022 resolves: rhbz#2149811 Fix Description field for Windows >= 10 in -o rhv/vdsm modes resolves: rhbz#2149863 Fix UEFI fallback boot loader if broken resolves: rhbz#2149629 Document Windows system on Dynamic Disk is not supported (2140548) Include the BOCHS DRM driver in the initial ram disk (2131123) Signed-off-by: Richard W.M. Jones --- ...clude-the-BOCHS-DRM-driver-in-the-in.patch | 49 ++++++++++ ...at-Windows-system-on-Dynamic-Disk-is.patch | 32 ++++++ ...o-to-distinguish-Windows-10-variants.patch | 59 +++++++++++ ...rt-windows-Introduce-osinfo-matching.patch | 97 +++++++++++++++++++ ...Copy-drivers-for-Windows-11-Windows-.patch | 77 +++++++++++++++ ...x.get_uefi_arch_suffix-move-to-Utils.patch | 61 ++++++++++++ ...fix-up-the-UEFI-fallback-boot-loader.patch | 87 +++++++++++++++++ copy-patches.sh | 2 +- virt-v2v.spec | 24 ++++- 9 files changed, 485 insertions(+), 3 deletions(-) create mode 100644 0035-convert_linux-include-the-BOCHS-DRM-driver-in-the-in.patch create mode 100644 0036-docs-Document-that-Windows-system-on-Dynamic-Disk-is.patch create mode 100644 0037-rhv-Use-osinfo-to-distinguish-Windows-10-variants.patch create mode 100644 0038-convert-windows-Introduce-osinfo-matching.patch create mode 100644 0039-convert-windows-Copy-drivers-for-Windows-11-Windows-.patch create mode 100644 0040-convert_linux.get_uefi_arch_suffix-move-to-Utils.patch create mode 100644 0041-convert_windows-fix-up-the-UEFI-fallback-boot-loader.patch diff --git a/0035-convert_linux-include-the-BOCHS-DRM-driver-in-the-in.patch b/0035-convert_linux-include-the-BOCHS-DRM-driver-in-the-in.patch new file mode 100644 index 0000000..9d53266 --- /dev/null +++ b/0035-convert_linux-include-the-BOCHS-DRM-driver-in-the-in.patch @@ -0,0 +1,49 @@ +From ea261c2e84aacaca4b3612c400117cb0e4929b36 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 30 Sep 2022 14:04:44 +0200 +Subject: [PATCH] convert_linux: include the BOCHS DRM driver in the initial + ram disk + +UEFI RHEL-7 guests cannot be successfully converted from VMWare without +including the BOCHS DRM driver -- Plymouth ("rhgb") crashes during early +boot in the converted domain. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2131123 +Signed-off-by: Laszlo Ersek +Message-Id: <20220930120444.11883-1-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +(cherry picked from commit aa69d64cd4526f1f7e3ddffd25a81f404936f853) +--- + convert/convert_linux.ml | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml +index b8e9ad15..5bfdac5a 100644 +--- a/convert/convert_linux.ml ++++ b/convert/convert_linux.ml +@@ -731,8 +731,13 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ = + match kernel.ki_initrd with + | None -> () + | Some initrd -> +- (* Enable the basic virtio modules in the kernel. *) +- (* Also forcibly include the "xts" module; see RHBZ#1658126. *) ++ (* Enable the basic virtio modules in the kernel. ++ * ++ * Also forcibly include the "xts" module; see RHBZ#1658126. ++ * ++ * Include the BOCHS DRM paravirt video driver; see RHBZ#2131123. This ++ * driver is known under two names -- "bochs-drm" and "bochs". ++ *) + let modules = + let modules = + (* The order of modules here is deliberately the same as the +@@ -743,7 +748,8 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ = + *) + List.filter (fun m -> List.mem m kernel.ki_modules) + [ "virtio"; "virtio_ring"; "virtio_blk"; +- "virtio_scsi"; "virtio_net"; "virtio_pci"; "xts" ] in ++ "virtio_scsi"; "virtio_net"; "virtio_pci"; "xts"; ++ "bochs-drm"; "bochs" ] in + if modules <> [] then modules + else + (* Fallback copied from old virt-v2v. XXX Why not "ide"? *) diff --git a/0036-docs-Document-that-Windows-system-on-Dynamic-Disk-is.patch b/0036-docs-Document-that-Windows-system-on-Dynamic-Disk-is.patch new file mode 100644 index 0000000..510c04f --- /dev/null +++ b/0036-docs-Document-that-Windows-system-on-Dynamic-Disk-is.patch @@ -0,0 +1,32 @@ +From 816d2b88919a8957df71944b21c52fef16265844 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 15 Nov 2022 10:17:02 +0000 +Subject: [PATCH] docs: Document that Windows system on Dynamic Disk is not + supported + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=2140548 +(cherry picked from commit 6aa09ca0a9e912e1ae2e984b384ee54eb5d5b3aa) +--- + docs/virt-v2v.pod | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod +index 912f1bc3..23919685 100644 +--- a/docs/virt-v2v.pod ++++ b/docs/virt-v2v.pod +@@ -926,6 +926,15 @@ For more information, see L + + =head2 Windows + ++=head3 System disk on a Dynamic Disk is not supported ++ ++If the Windows system disk (the drive containing C<\windows>) is ++located on a Dynamic Disk then it cannot be converted. Data disks — ++that is, disks which are part of the guest but do not contain parts of ++the Windows operating system — may be Dynamic Disks. ++ ++See L. ++ + =head3 Windows E 8 Fast Startup is incompatible with virt-v2v + + Guests which use the Windows E 8 "Fast Startup" feature (or guests diff --git a/0037-rhv-Use-osinfo-to-distinguish-Windows-10-variants.patch b/0037-rhv-Use-osinfo-to-distinguish-Windows-10-variants.patch new file mode 100644 index 0000000..7a3664a --- /dev/null +++ b/0037-rhv-Use-osinfo-to-distinguish-Windows-10-variants.patch @@ -0,0 +1,59 @@ +From f708a4ba1bcd5cb3be8c2f91a347cd3eed81c8b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 1 Dec 2022 10:53:12 +0000 +Subject: [PATCH] rhv: Use osinfo to distinguish Windows >= 10 variants + +Windows versions >= 10 no longer use the NT major.minor numbering +scheme (it is fixed at 10.0). Libguestfs >= 1.49.8 can distinguish +these versions and it sets correctly, so use that instead. + +After this change the OVF will contain: + + Windows 10 Pro + windows_11 + +which is strange, but apparently what Microsoft intended. As far as +RHV is concerned it only needs to choose the correct +devices etc. + +Reported-by: Tingting Zheng +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2149863 +Reviewed-by: Laszlo Ersek +(cherry picked from commit 38b35f3b7e5c6e5aea5dece5f77561b8332d3360) +--- + lib/create_ovf.ml | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/lib/create_ovf.ml b/lib/create_ovf.ml +index 18e86d6c..8aff3d8f 100644 +--- a/lib/create_ovf.ml ++++ b/lib/create_ovf.ml +@@ -231,13 +231,22 @@ and get_ostype = function + i_arch = "i386" } -> + "windows_10" + ++ (* For Windows NT 10.0 always use the field since the ++ * other fields will not accurately reflect the version. ++ *) + | { i_type = "windows"; i_major_version = 10; i_minor_version = 0; +- i_arch = "x86_64"; i_product_variant = "Client" } -> +- "windows_10x64" +- +- | { i_type = "windows"; i_major_version = 10; i_minor_version = 0; +- i_arch = "x86_64" } -> +- "windows_2016x64" ++ i_arch = "x86_64"; i_osinfo = osinfo; i_product_name = product } -> ++ (match osinfo with ++ | "win10" -> "windows_10x64" ++ | "win11" -> "windows_11" ++ | "win2k16" -> "windows_2016x64" ++ | "win2k19" -> "windows_2019x64" ++ | "win2k22" -> "windows_2022" ++ | _ -> ++ warning (f_"unknown Windows 10 variant: %s (%s)") ++ osinfo product; ++ "windows_2022" ++ ) + + | { i_type = typ; i_distro = distro; + i_major_version = major; i_minor_version = minor; i_arch = arch; diff --git a/0038-convert-windows-Introduce-osinfo-matching.patch b/0038-convert-windows-Introduce-osinfo-matching.patch new file mode 100644 index 0000000..8e3209d --- /dev/null +++ b/0038-convert-windows-Introduce-osinfo-matching.patch @@ -0,0 +1,97 @@ +From f83a1b246c3ffeaed5fd7d4ef0525a608820b6c1 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 2 Dec 2022 10:04:25 +0000 +Subject: [PATCH] convert: windows: Introduce osinfo matching + +This neutral refactoring allows us to match drivers with virtio-win +guests using the inspect osinfo field. This change adds an +"any_osinfo" predicate which matches any osinfo field. The following +commit will add more cases for Windows >= 10 and use the osinfo field +to distinguish them. + +(cherry picked from commit 7866fecbe5223eb8dec7c5cc8882d0130ccfba44) +--- + convert/windows_virtio.ml | 39 +++++++++++++++++++++------------------ + 1 file changed, 21 insertions(+), 18 deletions(-) + +diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml +index 183166b7..0f71fa94 100644 +--- a/convert/windows_virtio.ml ++++ b/convert/windows_virtio.ml +@@ -50,9 +50,9 @@ let rec install_drivers ((g, _) as reg) inspect = + g#mkdir_p driverdir; + + if not (copy_drivers g inspect driverdir) then ( +- warning (f_"there are no virtio drivers available for this version of Windows (%d.%d %s %s). virt-v2v looks for drivers in %s\n\nThe guest will be configured to use slower emulated devices.") ++ warning (f_"there are no virtio drivers available for this version of Windows (%d.%d %s %s %s). virt-v2v looks for drivers in %s\n\nThe guest will be configured to use slower emulated devices.") + inspect.i_major_version inspect.i_minor_version inspect.i_arch +- inspect.i_product_variant virtio_win; ++ inspect.i_product_variant inspect.i_osinfo virtio_win; + (IDE, RTL8139, false, false, false, false) + ) + else ( +@@ -280,7 +280,8 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing = + *) + and virtio_iso_path_matches_guest_os path inspect = + let { i_major_version = os_major; i_minor_version = os_minor; +- i_arch = arch; i_product_variant = os_variant } = inspect in ++ i_arch = arch; i_product_variant = os_variant; ++ i_osinfo = osinfo } = inspect in + try + (* Lowercased path, since the ISO may contain upper or lowercase path + * elements. +@@ -301,37 +302,39 @@ and virtio_iso_path_matches_guest_os path inspect = + + let is_client os_variant = os_variant = "Client" + and not_client os_variant = os_variant <> "Client" +- and any_variant os_variant = true in +- let p_os_major, p_os_minor, match_os_variant = ++ and any_variant os_variant = true ++ and any_osinfo osinfo = true in ++ let p_os_major, p_os_minor, match_os_variant, match_osinfo = + if pathelem "xp" || pathelem "winxp" then +- (5, 1, any_variant) ++ (5, 1, any_variant, any_osinfo) + else if pathelem "2k3" || pathelem "win2003" then +- (5, 2, any_variant) ++ (5, 2, any_variant, any_osinfo) + else if pathelem "vista" then +- (6, 0, is_client) ++ (6, 0, is_client, any_osinfo) + else if pathelem "2k8" || pathelem "win2008" then +- (6, 0, not_client) ++ (6, 0, not_client, any_osinfo) + else if pathelem "w7" || pathelem "win7" then +- (6, 1, is_client) ++ (6, 1, is_client, any_osinfo) + else if pathelem "2k8r2" || pathelem "win2008r2" then +- (6, 1, not_client) ++ (6, 1, not_client, any_osinfo) + else if pathelem "w8" || pathelem "win8" then +- (6, 2, is_client) ++ (6, 2, is_client, any_osinfo) + else if pathelem "2k12" || pathelem "win2012" then +- (6, 2, not_client) ++ (6, 2, not_client, any_osinfo) + else if pathelem "w8.1" || pathelem "win8.1" then +- (6, 3, is_client) ++ (6, 3, is_client, any_osinfo) + else if pathelem "2k12r2" || pathelem "win2012r2" then +- (6, 3, not_client) ++ (6, 3, not_client, any_osinfo) + else if pathelem "w10" || pathelem "win10" then +- (10, 0, is_client) ++ (10, 0, is_client, any_osinfo) + else if pathelem "2k16" || pathelem "win2016" then +- (10, 0, not_client) ++ (10, 0, not_client, any_osinfo) + else + raise Not_found in + + arch = p_arch && os_major = p_os_major && os_minor = p_os_minor && +- match_os_variant os_variant ++ match_os_variant os_variant && ++ match_osinfo osinfo + + with Not_found -> false + diff --git a/0039-convert-windows-Copy-drivers-for-Windows-11-Windows-.patch b/0039-convert-windows-Copy-drivers-for-Windows-11-Windows-.patch new file mode 100644 index 0000000..a6453df --- /dev/null +++ b/0039-convert-windows-Copy-drivers-for-Windows-11-Windows-.patch @@ -0,0 +1,77 @@ +From 94217004b0ea3292686397e29434a4cff1134e5e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 1 Dec 2022 12:29:43 +0000 +Subject: [PATCH] convert: windows: Copy drivers for Windows 11, Windows 2019 & + Windows 2022 + +If the virtio-win ISO contains drivers for Windows 11, Windows 2019 or +Windows 2022, and the guest matches these, then copy in the right +drivers. For this to work you will need libguestfs >= 1.49.8 which +allows osinfo to be used to detect Windows versions >= 10. + +Side note: virtio-win uses a mix of different path element styles. + +In the exploded tree of drivers installed by the RPM: + + /usr/share/virtio-win/drivers/amd64$ ls -l + total 0 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win10 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win11 + drwxr-xr-x. 2 root root 236 Nov 30 13:28 Win2008R2 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win2012 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win2012R2 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win2016 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win2019 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win2022 + drwxr-xr-x. 2 root root 236 Nov 30 13:28 Win7 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win8 + drwxr-xr-x. 2 root root 174 Nov 30 13:28 Win8.1 + +Inside the ISO: + + > ll /viostor/ + total 28 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 2k12 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 2k12R2 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 2k16 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 2k19 + dr-xr-xr-x 1 root root 2048 Dec 11 2021 2k22 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 2k8R2 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 w10 + dr-xr-xr-x 1 root root 2048 Dec 11 2021 w11 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 w7 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 w8 + dr-xr-xr-x 1 root root 2048 Jun 14 2020 w8.1 + +So I have matched both path elements. + +Reported-by: Tingting Zheng +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2149811 +Reviewed-by: Laszlo Ersek +(cherry picked from commit 7b49177e2b0c769b947ed19fa029c80282a2b93b) +--- + convert/windows_virtio.ml | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml +index 0f71fa94..76c94790 100644 +--- a/convert/windows_virtio.ml ++++ b/convert/windows_virtio.ml +@@ -326,9 +326,15 @@ and virtio_iso_path_matches_guest_os path inspect = + else if pathelem "2k12r2" || pathelem "win2012r2" then + (6, 3, not_client, any_osinfo) + else if pathelem "w10" || pathelem "win10" then +- (10, 0, is_client, any_osinfo) ++ (10, 0, is_client, ((=) "win10")) ++ else if pathelem "w11" || pathelem "win11" then ++ (10, 0, is_client, ((=) "win11")) + else if pathelem "2k16" || pathelem "win2016" then +- (10, 0, not_client, any_osinfo) ++ (10, 0, not_client, ((=) "win2k16")) ++ else if pathelem "2k19" || pathelem "win2019" then ++ (10, 0, not_client, ((=) "win2k19")) ++ else if pathelem "2k22" || pathelem "win2022" then ++ (10, 0, not_client, ((=) "win2k22")) + else + raise Not_found in + diff --git a/0040-convert_linux.get_uefi_arch_suffix-move-to-Utils.patch b/0040-convert_linux.get_uefi_arch_suffix-move-to-Utils.patch new file mode 100644 index 0000000..7dd90ef --- /dev/null +++ b/0040-convert_linux.get_uefi_arch_suffix-move-to-Utils.patch @@ -0,0 +1,61 @@ +From 3ffada4717e1f90843c67b2292ac7b9c6880c79c Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 2 Dec 2022 13:44:08 +0100 +Subject: [PATCH] convert_linux.get_uefi_arch_suffix: move to Utils + +So that Windows conversion can use the same function. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2149629 +Signed-off-by: Laszlo Ersek +Message-Id: <20221202124409.11741-2-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +(cherry picked from commit b13813b527856749bea4087cb9c6deba2d67eff6) +--- + convert/convert_linux.ml | 6 ------ + lib/utils.ml | 5 +++++ + lib/utils.mli | 5 +++++ + 3 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml +index 5bfdac5a..cde3b037 100644 +--- a/convert/convert_linux.ml ++++ b/convert/convert_linux.ml +@@ -1327,12 +1327,6 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ = + info (f_"Can't fix UEFI bootloader. VM may not boot.") + in + +- let get_uefi_arch_suffix = function +- | "x86_64" -> Some "X64" +- | "i386" -> Some "X32" +- | _ -> None +- in +- + match get_uefi_arch_suffix inspect.i_arch with + | None -> cant_fix_uefi () + | Some suffix -> ( +diff --git a/lib/utils.ml b/lib/utils.ml +index 84b9a93f..e355eb3e 100644 +--- a/lib/utils.ml ++++ b/lib/utils.ml +@@ -259,3 +259,8 @@ let get_disk_allocated ~dir ~disknr = + Some !allocated + ) else None + ) ++ ++let get_uefi_arch_suffix = function ++ | "x86_64" -> Some "X64" ++ | "i386" -> Some "X32" ++ | _ -> None +diff --git a/lib/utils.mli b/lib/utils.mli +index d431e21f..5687bf75 100644 +--- a/lib/utils.mli ++++ b/lib/utils.mli +@@ -98,3 +98,8 @@ val get_disk_allocated : dir:string -> disknr:int -> int64 option + image, according to the "base:allocation" metadata context. If the context + is not supported by the NBD server behind the socket, the function returns + None. *) ++ ++val get_uefi_arch_suffix : string -> string option ++(** [get_uefi_arch_suffix arch] maps [arch] from [inspect.i_arch] representation ++ to UEFI spec representation. If a mapping cannot be found, [None] is ++ returned. *) diff --git a/0041-convert_windows-fix-up-the-UEFI-fallback-boot-loader.patch b/0041-convert_windows-fix-up-the-UEFI-fallback-boot-loader.patch new file mode 100644 index 0000000..f56c47f --- /dev/null +++ b/0041-convert_windows-fix-up-the-UEFI-fallback-boot-loader.patch @@ -0,0 +1,87 @@ +From 796573e6f530d4736bcd9d81a6dc113f928a4d27 Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Fri, 2 Dec 2022 13:44:09 +0100 +Subject: [PATCH] convert_windows: fix up the UEFI fallback boot loader if + broken + +The "fallback" (or "default") boot behavior is described at great length +here: + +https://blog.uncooperative.org/uefi/linux/shim/efi%20system%20partition/2014/02/06/the-efi-system-partition.html + +The gist of it applies to all UEFI OSes, including Windows. For the +fallback boot behavior to work, the \EFI\BOOT\BOOTX64.efi boot loader on +the EFI system partition must match the installed operating system. We've +encountered a physical machine, during a virt-p2v conversion, where (a) +\EFI\BOOT\BOOTX64.efi belongs to a previously installed, but now wiped, +RHEL (hence shim+grub) deployment, and (b) the currently installed +operating system is Windows. + +Virt-v2v never transfers the UEFI variables (including the UEFI boot +options) of the source, therefore the converted VM always relies on the +default boot behavior when it is first started up. In the above scenario, +where \EFI\BOOT\BOOTX64.efi is actually "shim", the mismatch is triggered +at first boot after conversion, and a broken grub shell is reached instead +of the Windows boot loader. + +Detect this situation by investigating \EFI\BOOT\BOOTX64.efi on the EFI +system partition of a Windows disk image. If the file is missing, or is +not -- as expected -- a duplicate of \EFI\Microsoft\Boot\bootmgfw.efi, +then copy the latter to the former. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2149629 +Signed-off-by: Laszlo Ersek +Message-Id: <20221202124409.11741-3-lersek@redhat.com> +Reviewed-by: Richard W.M. Jones +(cherry picked from commit 9d4b58dcecc40da5c97a0e716f44757c422160f0) +--- + convert/convert_windows.ml | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml +index 34a5044d..57a7ff03 100644 +--- a/convert/convert_windows.ml ++++ b/convert/convert_windows.ml +@@ -836,17 +836,42 @@ let convert (g : G.guestfs) _ inspect _ static_ips = + ); + with + Not_found -> () ++ ++ and fix_win_uefi_fallback esp_path uefi_arch = ++ (* [esp_path] is on NTFS, and therefore it is considered case-sensitive; ++ * refer to ++ * . ++ * However, the EFI system partition mounted under [esp_path] is FAT32 per ++ * UEFI spec, and the Linux vfat driver in the libguestfs appliance treats ++ * pathnames case-insensitively. Therefore, we're free to use any case in ++ * the ESP-relative pathnames below. ++ *) ++ let bootmgfw = sprintf "%s/efi/microsoft/boot/bootmgfw.efi" esp_path in ++ if g#is_file bootmgfw then ++ let bootdir = sprintf "%s/efi/boot" esp_path in ++ let fallback = sprintf "%s/boot%s.efi" bootdir uefi_arch in ++ if not (g#is_file fallback) || not (g#equal fallback bootmgfw) then ( ++ info (f_"Fixing UEFI bootloader."); ++ g#rm_rf bootdir; ++ g#mkdir_p bootdir; ++ g#cp_a bootmgfw fallback ++ ) + in + + match inspect.i_firmware with + | I_BIOS -> () + | I_UEFI esp_list -> + let esp_temp_path = g#mkdtemp "/Windows/Temp/ESP_XXXXXX" in ++ let uefi_arch = get_uefi_arch_suffix inspect.i_arch in + + List.iter ( + fun dev_path -> + g#mount dev_path esp_temp_path; + fix_win_uefi_bcd esp_temp_path; ++ (match uefi_arch with ++ | Some uefi_arch -> fix_win_uefi_fallback esp_temp_path uefi_arch ++ | None -> () ++ ); + g#umount esp_temp_path; + ) esp_list; + diff --git a/copy-patches.sh b/copy-patches.sh index 6a3c4f6..f7dd9d9 100755 --- a/copy-patches.sh +++ b/copy-patches.sh @@ -7,7 +7,7 @@ set -e # ./copy-patches.sh project=virt-v2v -rhel_version=9.1 +rhel_version=9.2 # Check we're in the right directory. if [ ! -f $project.spec ]; then diff --git a/virt-v2v.spec b/virt-v2v.spec index 58a5b21..9c19184 100644 --- a/virt-v2v.spec +++ b/virt-v2v.spec @@ -16,7 +16,7 @@ Name: virt-v2v Epoch: 1 Version: 2.0.7 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Convert a virtual machine to run on KVM License: GPLv2+ @@ -32,6 +32,9 @@ Source2: libguestfs.keyring # Maintainer script which helps with handling patches. Source3: copy-patches.sh +# Patches are maintained in the following repository: +# https://github.com/libguestfs/virt-v2v/commits/rhel-9.2 + # Patches. Patch0001: 0001-RHEL-v2v-Select-correct-qemu-binary-for-o-qemu-mode-.patch Patch0002: 0002-RHEL-v2v-Disable-the-qemu-boot-oo-qemu-boot-option-R.patch @@ -67,6 +70,13 @@ Patch0031: 0031-input-xen-cover-RHEL9-OpenSSL-crypto-settings.patch Patch0032: 0032-convert_linux-remove-LVM2-devices-file.patch Patch0033: 0033-convert-linux-Add-support-for-Zstandard-compressed-k.patch Patch0034: 0034-convert_linux-start-the-QEMU-guest-agent-in-a-distro.patch +Patch0035: 0035-convert_linux-include-the-BOCHS-DRM-driver-in-the-in.patch +Patch0036: 0036-docs-Document-that-Windows-system-on-Dynamic-Disk-is.patch +Patch0037: 0037-rhv-Use-osinfo-to-distinguish-Windows-10-variants.patch +Patch0038: 0038-convert-windows-Introduce-osinfo-matching.patch +Patch0039: 0039-convert-windows-Copy-drivers-for-Windows-11-Windows-.patch +Patch0040: 0040-convert_linux.get_uefi_arch_suffix-move-to-Utils.patch +Patch0041: 0041-convert_windows-fix-up-the-UEFI-fallback-boot-loader.patch %if !0%{?rhel} # libguestfs hasn't been built on i686 for a while since there is no @@ -127,7 +137,7 @@ BuildRequires: nbdkit-python-plugin BuildRequires: gnupg2 %endif -Requires: libguestfs%{?_isa} >= 1:1.48.4-2.el9 +Requires: libguestfs%{?_isa} >= 1:1.48.4-4.el9 Requires: guestfs-tools >= 1.42 # XFS is the default filesystem in Fedora and RHEL. @@ -345,6 +355,16 @@ rm $RPM_BUILD_ROOT%{_mandir}/man1/virt-v2v-in-place.1* %changelog +* Fri Dec 02 2022 Richard W.M. Jones - 1:2.0.7-7 +- Copy drivers for Windows 11, Windows 2019 & Windows 2022 + resolves: rhbz#2149811 +- Fix Description field for Windows >= 10 in -o rhv/vdsm modes + resolves: rhbz#2149863 +- Fix UEFI fallback boot loader if broken + resolves: rhbz#2149629 +- Document Windows system on Dynamic Disk is not supported (2140548) +- Include the BOCHS DRM driver in the initial ram disk (2131123) + * Thu Aug 18 2022 Laszlo Ersek - 1:2.0.7-6 - Install qemu-ga package during conversion resolves: rhbz#2028764