commit:     b7410f4912aa4955067e2fef7c3938088a05bd88
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 11 15:07:09 2019 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Tue Jun 11 15:09:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7410f49

linux-mod.eclass: Add support for kernels >=3.X in convert_to_m

SUBDIRS= will be removed from Linux 5.3. See bug #680976

The linux-mod.eclass includes the function convert_to_m() that is supposed
to fix Makefiles converting them from SUBDIRS= to M=. The auxiliary
function use_m(), needed by convert_to_m(), is used to verify the kernel
version before deciding to patch a file. Currently the check supports only
kernel <= 3

Thanks to Fabio Rossi

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 eclass/linux-mod.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index de005967a36..b6dc2c84d09 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -208,7 +208,7 @@ use_m() {
 
        # if the kernel version is greater than 2.6.6 then we should use
        # M= instead of SUBDIRS=
-       [ ${KV_MAJOR} -eq 3 ] && return 0
+       [ ${KV_MAJOR} -ge 3 ] && return 0
        [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \
                return 0 || return 1
 }

Reply via email to