Followup-For: Bug #1057447
Control: found -1 6.30.223.271-24~exp1
Control: tag -1 + patch

This issue is caused by
a) version parsing that expects three numeric components (6.6.1-foo) and
   fails if there are only two (6.7-rc1)
b) broken version comparison logic
which turn on APICHOICE=FORCE_WEXT on kernels without
CONFIG_WIRELESS_EXT

Attached patch fixes that.

Verified to be able to build a module for 6.7-cloud-amd64.


Andreas
Author: Andreas Beckmann <a...@debian.org>
Description: fix detection of LINUXVER_WEXT_ONLY
 - fix version parsing if there are only two numeric components (e.g. 6.7-rc1)
 - set SUBLEVEL to 0 if missing
 - fix version comparison logic
 - -a and -o don't have well defined precedence
Bug-Debian: https://bugs.debian.org/1057447

--- a/amd64/Makefile
+++ b/amd64/Makefile
@@ -20,20 +20,22 @@
 
 ifneq ($(KERNELRELEASE),)
 
-  VERSION := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\1/')
-  PATCHLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\2/')
-  SUBLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\3/')
+  VERSION := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)\(.*\)/\1/')
+  PATCHLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)\(.*\)/\2/')
+  SUBLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 
's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\3/; 
s/\([0-9]*\)[.]\([0-9]*\)\(.*\)/0/')
 
+  # >= 2.6.32
   LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \
-    if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge 
"32" -o "$(VERSION)" -ge "3" ]; then \
+    if [ "$(VERSION).$(PATCHLEVEL)" = "2.6" -a "$(SUBLEVEL)" -ge "32" ] || [ 
"$(VERSION)" -eq "2" -a "$(PATCHLEVEL)" -ge "7" ] || [ "$(VERSION)" -ge "3" ]; 
then \
       echo TRUE; \
     else \
       echo FALSE; \
     fi \
   ))
 
+  # < 2.6.17
     LINUXVER_WEXT_ONLY:=$(strip $(shell \
-    if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge 
"17" ]; then \
+    if [ "$(VERSION).$(PATCHLEVEL)" = "2.6" -a "$(SUBLEVEL)" -ge "17" ] || [ 
"$(VERSION)" -eq "2" -a "$(PATCHLEVEL)" -ge "7" ] || [ "$(VERSION)" -ge "3" ]; 
then \
       echo FALSE; \
     else \
       echo TRUE; \

Reply via email to