tools-utils.cc: Support collecting kernel binary paths build from sources

Message ID 87mso6t09g.fsf@redhat.com
State New
Headers
Series tools-utils.cc: Support collecting kernel binary paths build from sources |

Commit Message

Dodji Seketeli May 31, 2024, 4:27 p.m. UTC
  Hello,

When 'abidw --lt /some/dir' runs with /some/dir being a linux kernel
tree built from source (as opposed to coming from a distribution),
get_binary_paths_from_kernel_dist misbehaves because it expects to
find modules somewhere under/lib/modules.  This patch makes it support
linux kernel trees built from source by looking for modules all over
the place, wherever they might be.

	* src/abg-tools-utils.cc (get_binary_paths_from_kernel_dist): Look
	for kernel modules under the root directory by default.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applying to the master branch.
---
 src/abg-tools-utils.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 95bd0be5..d24fdc61 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -2858,7 +2858,7 @@  get_binary_paths_from_kernel_dist(const string&	dist_root,
   // under the 'debug_info_root_path' directory and its content is
   // accessible from <debug_info_root_path>/usr/lib/debug directory.
 
-  string kernel_modules_root;
+  string kernel_modules_root = dist_root;
   string debug_info_root;
   if (dir_exists(dist_root + "/lib/modules"))
     {