Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1695760 - [FEAT]: Do not import weak-module -debug and non-debug kernel module information
Summary: [FEAT]: Do not import weak-module -debug and non-debug kernel module information
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: kmod
Version: 8.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 8.0
Assignee: Yauheni Kaliuta
QA Contact: Ziqian SUN (Zamir)
Depends On:
TreeView+ depends on / blocked
Reported: 2019-04-03 17:54 UTC by Prarit Bhargava
Modified: 2019-04-16 09:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-04-16 09:43:48 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

Description Prarit Bhargava 2019-04-03 17:54:10 UTC
Description of problem:  If I install a kernel, add weak module, and then install the kernel-debug packages, /usr/sbin/weak-modules will attempt to import the weak-module from the non-debug kernel into the debug kernel.

Version-Release number of selected component (if applicable): kmod-25-11.el8.x86_64

How reproducible: 

Steps to Reproduce:
1. install kernel-4.18.0-80.el8
2. build and add a dummy entry to lib/modules/4.18.0-80.el8.x86_64/extra

(This can be easily done in the kernel git tree by compiling redhat/debug/dummy_module/)

3. install kernel-debug-4.18.0-80.el8 

Actual results: The /usr/sbin/weak-modules script will import the /extra module from the non-debug kernel into the debug kernel.  Even if this is resolved some other way (see, it is a waste of time to look at the non-debug and debug kernel comparison.  We know they are significantly different.

Expected results: Do not make a -debug & non-debug kernel comparison

Additional info:

+is_debug_kernel() {
+    local krel=${1:-$(uname -r)}
+    [ $(expr "$krel" : '.*\+debug') -ne 0 ] && echo "debug" && return
+    echo "notdebug"
+is_rpm() {
+    rpm -qf /lib/modules/$1 >&/dev/null
+    [ $? -eq 0 ] && rpm -qf /lib/modules/$1 && return 0
+    echo ""
+	if [ $(is_rpm "$k") ] && [ $(is_rpm "$krel") ]; then
+	    # do not mix modules from debug and non-debug kernels
+	    if [ $(is_debug_kernel "$krel") != $(is_debug_kernel "$k") ]; then
+                pr_verbose "debug/non-debug rpm kernel: skipping modules for $k"
+		continue
+	    fi

Comment 1 Yauheni Kaliuta 2019-04-16 09:43:48 UTC
While it will help a in this particular scenario (kernel and debug kernel installed) I do not see a lot of advantage of the shortcut for the end customer and see more mess in the script.

Note You need to log in before you can comment on or make changes to this bug.