[Pkg-iscsi-maintainers] [SCM] Debian iscsitarget packaging branch, master, updated. debian/1.4.20.1-1-2-gdcd95d6

Ritesh Raj Sarraf rrs at researchut.com
Wed May 12 17:55:17 UTC 2010


The following commit has been merged in the master branch:
commit dcd95d6d7a50da8a5cca8f33a6f496cb3364e815
Author: Ritesh Raj Sarraf <rrs at researchut.com>
Date:   Wed May 12 23:23:44 2010 +0530

    take care of older kernels also

diff --git a/debian/changelog b/debian/changelog
index 2acb5cd..7deadf6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
 iscsitarget (1.4.20.1-2) UNRELEASED; urgency=low
 
   * Change address to my official Debian address and remove the DMUA flag
+  * Handle older kernel versions patches that upstream still supports. This
+    should allow compiling iscsitarget with older kernels now.
+    (Closes: #581200) 
 
- -- Ritesh Raj Sarraf <rrs at debian.org>  Thu, 06 May 2010 23:07:07 +0530
+ -- Ritesh Raj Sarraf <rrs at debian.org>  Wed, 12 May 2010 23:22:04 +0530
 
 iscsitarget (1.4.20.1-1) unstable; urgency=low
 
diff --git a/debian/rules b/debian/rules
index aeb69c1..696a6fd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -52,6 +52,91 @@ endif
 
 KERN_VER=$(shell echo $(KVERS) | cut -d "-" -f1)
 
+KVER=$(shell uname -r | cut -d "-" -f1)
+
+# Taken from upstream iscsitarget's Makefile
+KMAJ := $(shell echo $(KVER) | \
+	sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
+KMIN := $(shell echo $(KVER) | \
+	sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/')
+KREV := $(shell echo $(KVER) | \
+	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) ] && \
+	echo 1 || echo 0)
+kver_lt = $(shell [ $(KMAJ)$(KMIN)$(KREV) -lt $(1)$(2)$(3) ] && \
+	echo 1 || echo 0)
+kver_le = $(shell [ $(KMAJ)$(KMIN)$(KREV) -le $(1)$(2)$(3) ] && \
+	echo 1 || echo 0)
+kver_gt = $(shell [ $(KMAJ)$(KMIN)$(KREV) -gt $(1)$(2)$(3) ] && \
+	echo 1 || echo 0)
+kver_ge = $(shell [ $(KMAJ)$(KMIN)$(KREV) -ge $(1)$(2)$(3) ] && \
+	echo 1 || echo 0)
+kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 || echo 0)
+
+
+# Compatibility patch for kernels <= 2.6.32
+ifeq ($(call kver_le,2,6,32),1)
+	PATCHES := $(PATCHES) compat-2.6.32.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.31
+ifeq ($(call kver_le,2,6,31),1)
+	PATCHES := $(PATCHES) compat-2.6.31.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.30
+ifeq ($(call kver_le,2,6,30),1)
+	PATCHES := $(PATCHES) compat-2.6.30.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.29
+ifeq ($(call kver_le,2,6,29),1)
+	PATCHES := $(PATCHES) compat-2.6.29.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.28
+ifeq ($(call kver_le,2,6,28),1)
+	PATCHES := $(PATCHES) compat-2.6.28.patch
+endif
+
+# Compatibility patch for kernels >= 2.6.25 and <= 2.6.27
+ifeq ($(call kver_le,2,6,27),1)
+	PATCHES := $(PATCHES) compat-2.6.25-2.6.27.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.24
+ifeq ($(call kver_le,2,6,24),1)
+	PATCHES := $(PATCHES) compat-2.6.24.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.23
+ifeq ($(call kver_le,2,6,23),1)
+	PATCHES := $(PATCHES) compat-2.6.23.patch
+endif
+
+# Compatibility patch for kernels <= 2.6.22
+ifeq ($(call kver_le,2,6,22),1)
+	PATCHES := $(PATCHES) compat-2.6.22.patch
+endif
+
+# Compatibility patch for kernels >= 2.6.19 and <= 2.6.21
+ifeq ($(call kver_le,2,6,21),1)
+	PATCHES := $(PATCHES) compat-2.6.19-2.6.21.patch
+endif
+
+# Compatibility patch for kernels >= 2.6.14 and <= 2.6.18
+ifeq ($(call kver_le,2,6,18),1)
+	PATCHES := $(PATCHES) compat-2.6.14-2.6.18.patch
+endif
+
+# We don't support kernels < 2.6.14 except for explicit distros
+ifeq ($(call kver_lt,2,6,14),1)
+	echo "unsupported kernel"
+	exit 1
+endif
+
+
 kdist_clean:
 	dh_clean
 	$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd)/kernel clean
@@ -59,8 +144,11 @@ kdist_clean:
 # prep-deb-files rewrites the debian/ files as needed. See RATIONALE for
 # details
 kdist_config: prep-deb-files
-# ... additional kernel specific things to configure...
-	test -f patches/compat-$(KERN_VER).patch && patch -p1 < patches/compat-$(KERN_VER).patch
+	for p in $(PATCHES); do \
+		echo "Applying patch $$p"; \
+		test -f patches/$$p && patch -p1 < patches/$$p \
+		#test -f patches/compat-$(KERN_VER).patch && patch -p1 < patches/compat-$(KERN_VER).patch \
+	done
 
 kdist_configure: kdist_config
 

-- 
Debian iscsitarget packaging



More information about the Pkg-iscsi-maintainers mailing list