[Pkg-iscsi-maintainers] Bug#581200: iscsitarget-source applies kernel compatibility patches the wrong way

Markus Schuster ml at markus.schuster.name
Thu May 13 15:32:50 UTC 2010


> > Would you be interested in testing this before I do the upload ?
> > The git repository can be fetched from the PTS page or else if you need a
> >  deb, let me know.
> 
> Yes, I'll checkout from git and give feedback. Currently I'm on work, give
>  me time till tomorrow.

I've tested your version from git and it looks very promising - I've just 
found one little bug: You use `uname -r` to determine what compatibility 
patches to apply. The problem is: When using module-assistant, you can specify 
another kernel to build for. In my case, my buildserver runs a 2.6.29 kernel, 
but I want to compile for lennys 2.6.26 kernel, so I run 
# m-a --kernel-dir=/usr/src/linux-headers-2.6.26-2-amd64/ --kvers-
list=2.6.26-2-amd64 build iscsitarget
But now only the patches up to 2.6.29 are applied and the build fails. 
But it's easy to fix, please have a look at my patch below:

--- cut ---
--- debian/rules.old    2010-05-13 15:21:38.810804362 +0000
+++ debian/rules        2010-05-13 15:22:29.860426357 +0000
@@ -52,14 +52,12 @@

 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) | \
+KMAJ := $(shell echo $(KERN_VER) | \
        sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
-KMIN := $(shell echo $(KVER) | \
+KMIN := $(shell echo $(KERN_VER) | \
        sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/')
-KREV := $(shell echo $(KVER) | \
+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) ] && \
@@ -72,7 +70,7 @@
        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)
+kver_lk = $(shell [ `echo $(KERN_VER) | egrep $(1)` ] && echo 1 || echo 0)


 # Compatibility patch for kernels <= 2.6.32
--- cut ---

Now it builds just fine here. 

Regards,
Markus





More information about the Pkg-iscsi-maintainers mailing list