Blame SOURCES/0033-convert-linux-Add-support-for-Zstandard-compressed-k.patch

c1a9fa
From 380fa6663e9b373d87e446fc03601e9e44f985f6 Mon Sep 17 00:00:00 2001
c1a9fa
From: "Richard W.M. Jones" <rjones@redhat.com>
c1a9fa
Date: Tue, 9 Aug 2022 19:09:08 +0100
c1a9fa
Subject: [PATCH] convert: linux: Add support for Zstandard compressed kernel
c1a9fa
 modules
c1a9fa
c1a9fa
OpenSUSE uses *.ko.zst for kernel modules.  This commit adds support
c1a9fa
in the same way as the existing support for *.ko.xz.  Note this
c1a9fa
requires a corresponding change to libguestfs to support Zstandard
c1a9fa
compression in the guestfs_file_architecture API:
c1a9fa
c1a9fa
https://github.com/libguestfs/libguestfs/commit/0e784824e82a88e522873fec5db1a11943d637ed
c1a9fa
c1a9fa
Reported-by: Xiaodai Wang
c1a9fa
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2116811
c1a9fa
(cherry picked from commit 315c016dbea899587649a4bbf1865390cb4e1d3c)
c1a9fa
---
c1a9fa
 convert/linux_kernels.ml | 10 +++++++---
c1a9fa
 1 file changed, 7 insertions(+), 3 deletions(-)
c1a9fa
c1a9fa
diff --git a/convert/linux_kernels.ml b/convert/linux_kernels.ml
c1a9fa
index 307de572..6e9d2bdd 100644
c1a9fa
--- a/convert/linux_kernels.ml
c1a9fa
+++ b/convert/linux_kernels.ml
c1a9fa
@@ -65,8 +65,8 @@ let print_kernel_info chan prefix ki =
c1a9fa
       ki.ki_supports_isa_pvpanic ki.ki_supports_virtio_socket
c1a9fa
       ki.ki_is_xen_pv_only_kernel ki.ki_is_debug
c1a9fa
 
c1a9fa
-let rex_ko = PCRE.compile "\\.k?o(?:\\.xz)?$"
c1a9fa
-let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.xz)?$"
c1a9fa
+let rex_ko = PCRE.compile "\\.k?o(?:\\.(?:xz|zst))?$"
c1a9fa
+let rex_ko_extract = PCRE.compile "/([^/]+)\\.k?o(?:\\.(?:xz|zst))?$"
c1a9fa
 
c1a9fa
 let detect_kernels (g : G.guestfs) inspect family bootloader =
c1a9fa
   (* What kernel/kernel-like packages are installed on the current guest? *)
c1a9fa
@@ -203,7 +203,11 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
c1a9fa
              let all_candidates = List.flatten (
c1a9fa
                List.map (
c1a9fa
                  fun f ->
c1a9fa
-                   [ "/" ^ f ^ ".o"; "/" ^ f ^ ".ko"; "/" ^ f ^ ".ko.xz" ]
c1a9fa
+                   [ "/" ^ f ^ ".o";
c1a9fa
+                     "/" ^ f ^ ".ko";
c1a9fa
+                     "/" ^ f ^ ".ko.xz";
c1a9fa
+                     "/" ^ f ^ ".ko.zst";
c1a9fa
+                   ]
c1a9fa
                ) candidates
c1a9fa
              ) in
c1a9fa
              let candidate =