1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From: Roger Shimizu <rosh@debian.org>
Date: Fri, 17 Apr 2020 00:08:34 +0900
Subject: Parse KERNELRELEASE into VERSION, PATCHLEVEL, and SUBLEVEL
This fixes build error message:
====
/bin/sh: 1: [: Illegal number:
/bin/sh: 1: [: Illegal number:
Wireless Extension is the only possible API for this kernel version
Using Wireless Extension API
====
Closes: #886512
---
amd64/Makefile | 4 ++++
i386/Makefile | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/amd64/Makefile b/amd64/Makefile
index 994a146..ed16dfc 100644
--- a/amd64/Makefile
+++ b/amd64/Makefile
@@ -20,6 +20,10 @@
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/')
+
LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \
if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" -o "$(VERSION)" -ge "3" ]; then \
echo TRUE; \
diff --git a/i386/Makefile b/i386/Makefile
index a323a0d..ec947d9 100644
--- a/i386/Makefile
+++ b/i386/Makefile
@@ -20,6 +20,10 @@
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/')
+
LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \
if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" -o "$(VERSION)" -ge "3" ]; then \
echo TRUE; \
|