[Pkg-iscsi-maintainers] Bug#632837:
James Harper
james.harper at bendigoit.com.au
Sun Sep 11 04:03:41 UTC 2011
The following patch gets the build going for me. I'm sure there is a
better way than calling out to printf though. It accomplishes two things
- expand kernel version to a canonical string instead of making the
assumption that the revision is 2 digits, and uses .ko for anything
greater or equal than 2.6, rather than exactly 2.6. With this patch the
module compiles and loads under 3.0.0, and ietd starts up, although I
haven't actually tested that it works yet.
diff -ur modules.old/iscsitarget/debian/rules
modules/iscsitarget/debian/rules
--- modules.old/iscsitarget/debian/rules 2011-08-07
06:41:19.000000000 +1000
+++ modules/iscsitarget/debian/rules 2011-09-11 13:52:35.000000000
+1000
@@ -49,9 +49,6 @@
# module-assistant stuff
MAJOR=$(shell echo $(KVERS) | sed -e 's/\(...\).*/\1/')
-ifeq ($(MAJOR),2.6)
-KO=k
-endif
KERN_VER=$(shell echo $(KVERS) | cut -d "-" -f1)
@@ -63,18 +60,22 @@
KREV := $(shell echo $(KERN_VER) | \
sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/')
-kver_eq = $(shell [ $(KMAJ)$(KMIN)$(KREV) -eq $(1)$(2)$(3) ] && \
+kver_eq = $(shell [ `/usr/bin/printf "%03d%03d%03d" $(KMAJ) $(KMIN)
$(KREV)` -eq `/usr/bin/printf "%03d%03d%03d" $(1) $(2) $(3)` ] && \
echo 1 || echo 0)
-kver_lt = $(shell [ $(KMAJ)$(KMIN)$(KREV) -lt $(1)$(2)$(3) ] && \
+kver_lt = $(shell [ `/usr/bin/printf "%03d%03d%03d" $(KMAJ) $(KMIN)
$(KREV)` -lt `/usr/bin/printf "%03d%03d%03d" $(1) $(2) $(3)` ] && \
echo 1 || echo 0)
-kver_le = $(shell [ $(KMAJ)$(KMIN)$(KREV) -le $(1)$(2)$(3) ] && \
+kver_le = $(shell [ `/usr/bin/printf "%03d%03d%03d" $(KMAJ) $(KMIN)
$(KREV)` -le `/usr/bin/printf "%03d%03d%03d" $(1) $(2) $(3)` ] && \
echo 1 || echo 0)
-kver_gt = $(shell [ $(KMAJ)$(KMIN)$(KREV) -gt $(1)$(2)$(3) ] && \
+kver_gt = $(shell [ `/usr/bin/printf "%03d%03d%03d" $(KMAJ) $(KMIN)
$(KREV)` -gt `/usr/bin/printf "%03d%03d%03d" $(1) $(2) $(3)` ] && \
echo 1 || echo 0)
-kver_ge = $(shell [ $(KMAJ)$(KMIN)$(KREV) -ge $(1)$(2)$(3) ] && \
+kver_ge = $(shell [ `/usr/bin/printf "%03d%03d%03d" $(KMAJ) $(KMIN)
$(KREV)` -ge `/usr/bin/printf "%03d%03d%03d" $(1) $(2) $(3)` ] && \
echo 1 || echo 0)
kver_lk = $(shell [ `echo $(KERN_VER) | egrep $(1)` ] && echo 1 || echo
0)
+ifeq ($(call kver_ge,2,6,0),1)
+KO=k
+endif
+
# Compatibility patch for kernels >= 2.6.36 <= 2.6.38
ifeq ($(call kver_le,2,6,38),1)
PATCHES := $(PATCHES) compat-2.6.36-2.6.37.patch
More information about the Pkg-iscsi-maintainers
mailing list