Blame SOURCES/0017-v2v-linux-canonicalize-module-path-for-arch-detectio.patch

da373f
From 999180eca864baf0a82267448de120d2ed0e4787 Mon Sep 17 00:00:00 2001
3efd08
From: Pino Toscano <ptoscano@redhat.com>
3efd08
Date: Wed, 20 Mar 2019 16:55:05 +0100
3efd08
Subject: [PATCH] v2v: linux: canonicalize module path for arch detection
3efd08
 (RHBZ#1690574)
3efd08
3efd08
Kernel modules can be also symlinks to files available outside the
3efd08
"canonical" module directory; the "file" API, used by the
3efd08
"file-architecture" API, return the actual type of a file (so symlinks,
3efd08
block devices, etc), and thus "file-architecture" fails on symlinks.
3efd08
3efd08
To prevent this situation, canonicalize the path of the module picked
3efd08
for architecture detection: this way, "file-architecture" will act on a
3efd08
real file.
3efd08
3efd08
(cherry picked from commit 0a093035d485b3c2e66d56541ebe159f1b632ba6)
3efd08
---
3efd08
 v2v/linux_kernels.ml | 2 +-
3efd08
 1 file changed, 1 insertion(+), 1 deletion(-)
3efd08
3efd08
diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml
3efd08
index 3313aabc7..889ec2f2a 100644
3efd08
--- a/v2v/linux_kernels.ml
3efd08
+++ b/v2v/linux_kernels.ml
3efd08
@@ -189,7 +189,7 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
3efd08
               *)
3efd08
              let arch =
3efd08
                let any_module = modpath ^ List.hd modules in
3efd08
-               g#file_architecture any_module in
3efd08
+               g#file_architecture (g#realpath any_module) in
3efd08
 
3efd08
              (* Just return the module names, without path or extension. *)
3efd08
              let modules = List.filter_map (
3efd08
-- 
da373f
2.18.4
3efd08