[Pkg-iscsi-maintainers] Bug#773235: iscsitarget-dkms fails to apply patches properly

Mark Debian mark_debian at yahoo.com
Mon Dec 15 20:52:02 UTC 2014


Package: <iscsitarget-dkms>
Version: <1.4.20.3+svn502-2>

I am running debian wheezy on an odroid U3 device.  I have compile a kernel using the 3.8.13 sources from github.com/hardkernel as follows:
# git clone --depth 1 https://github.com/hardkernel/linux.git -b odroid-3.8.y linux-3.8.13-odroidu3

The kernel works.

I manually downloaded the iscsitarget-dkms and iscsitarget debs from debian unstable
iscsitarget_1.4.20.3+svn502-2_armhf.deb
iscsitarget-dkms_1.4.20.3+svn502-2_all.deb
and installed them using dpkg.

I have created the build and source symlinks in /lib/modules/3.8.13-odroidu3 to point to /usr/sr/linux-3.8.13-odroidu3/

However dkms fails to build iscsitarget-dkms using:

# dkms build -m iscsitarget -v 1.4.20.3+svn502

And the make log shows:
cat /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/make.log 
DKMS make.log for iscsitarget-1.4.20.3+svn502 for kernel 3.8.13-28-odroidu3 (armv7l)
Sunday 14 December  11:00:39 AEST 2014
make: Entering directory `/usr/src/linux-headers-3.8.13-28-odroidu3'
  LD      /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/built-in.o
  LD      /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/built-in.o
  CC [M]  /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.o
In file included from include/linux/timex.h:65:0,
                 from include/linux/sched.h:17,
                 from include/linux/blkdev.h:4,
                 from /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/iscsi.h:11,
                 from /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.c:7:
/usr/src/linux-headers-3.8.13-28-odroidu3/arch/arm/include/asm/timex.h:18:24:
 fatal error: mach/timex.h: No such file or directory
compilation terminated.
make[2]: *** [/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.o] Error 1
make[1]: *** [/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel] Error 2
make: *** [_module_/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build] Error 2
make: Leaving directory `/usr/src/linux-headers-3.8.13-28-odroidu3'
I have worked around this problem and got iscsitarget-dkms to compile by modifying  /usr/src/iscsitarget-1.4.20.3+svn502/dkms.confto have the patches compat-3.13.patch, compat-3.12.patch, and compat-3.9.patch apply which weren't applying.  I needed to change the PATCH_MATCH regexes and add some patches.  Here is what my dkms.conf file looks like now:
PACKAGE_NAME="iscsitarget"
PACKAGE_VERSION="1.4.20.3+svn502"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="iscsi_trgt"
BUILT_MODULE_LOCATION[0]="kernel/"
DEST_MODULE_LOCATION[0]="/kernel/drivers/iscsi/"

PATCH[0]="compat-3.13.patch"
PATCH_MATCH[0]="(2\.6\.(9|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)|3\.(0|1|2|3|4|5|6|7|8|9)\.*)"
PATCH[1]="compat-3.12.patch"
PATCH_MATCH[1]="(2\.6\.(9|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)|3\.(0|1|2|3|4|5|6|7|8|9)\.*)"
PATCH[2]="compat-3.9.patch"
PATCH_MATCH[2]="(2\.6\.(9|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)|3\.(0|1|2|3|4|5|6|7|8|9)\.*)"
PATCH[3]="compat-3.6.patch"
PATCH_MATCH[3]="(2\.6\.(9|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)|3\.(0|1|2|3|4|5|6)\.0)"
PATCH[4]="compat-3.5.patch"
PATCH_MATCH[4]="(2\.6\.(9|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)|3\.(0|1|2|3|4|5)\.0)"
PATCH[5]="compat-3.2-3.4.patch"
PATCH_MATCH[5]="(2\.6\.(9|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)|3\.(0|1|2|3|4)\.0)"
PATCH[6]="compat-2.6.39-3.2.patch"
PATCH_MATCH[6]="(2\.6\.(9|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)|3\.(0|1|2)\.0)"
PATCH[7]="compat-2.6.38.patch"
PATCH_MATCH[7]="2\.6\.(9|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)"
PATCH[8]="compat-2.6.36-2.6.37.patch"
PATCH_MATCH[8]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37)"
PATCH[9]="compat-2.6.33-2.6.35.patch"
PATCH_MATCH[9]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35)"
PATCH[10]="compat-2.6.32.patch"
PATCH_MATCH[10]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32)"
PATCH[11]="compat-2.6.31.patch"
PATCH_MATCH[11]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)"
PATCH[12]="compat-2.6.30.patch"
PATCH_MATCH[12]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30)"
PATCH[13]="compat-2.6.29.patch"
PATCH_MATCH[13]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)"
PATCH[14]="compat-2.6.28.patch"
PATCH_MATCH[14]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)"
PATCH[15]="compat-2.6.25-2.6.27.patch"
PATCH_MATCH[15]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)"
PATCH[16]="compat-2.6.24.patch"
PATCH_MATCH[16]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)"
PATCH[17]="compat-2.6.23.patch"
PATCH_MATCH[17]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)"
PATCH[18]="compat-2.6.22.patch"
PATCH_MATCH[18]="2\.6\.(9|14|15|16|17|18|19|20|21|22)"
PATCH[19]="compat-2.6.19-2.6.21.patch"
PATCH_MATCH[19]="2\.6\.(9|14|15|16|17|18|19|20|21)"
PATCH[20]="compat-2.6.14-2.6.18.patch"
PATCH_MATCH[20]="2\.6\.(9|14|15|16|17|18)"
PATCH[21]="compat-sles10sp2.patch"
PATCH_MATCH[21]="2\.6\.16\.60-.*"
PATCH[22]="compat-rhel4.patch"
PATCH_MATCH[22]="2\.6\.9-.*\.(el|plus\.c4)"

I also needed to modify the compat-3.13.patch by deleting the diff for Makefile leaving only the diff for kernel/block-io.c.  My /usr/src/iscsitarget-1.4.20.3+svn502/patches/compat-3.13.patch now looks like:
diff --git b/kernel/block-io.c a/kernel/block-io.c
index 00365b5..7c9ea21 100644
--- b/kernel/block-io.c
+++ a/kernel/block-io.c
@@ -87,7 +87,7 @@ blockio_make_request(struct iet_volume *volume, struct tio *tio, int rw)
         }
 
         /* bi_sector is ALWAYS in units of 512 bytes */
-        bio->bi_iter.bi_sector = ppos >> 9;
+        bio->bi_sector = ppos >> 9;
         bio->bi_bdev = bio_data->bdev;
         bio->bi_end_io = blockio_bio_endio;
         bio->bi_private = tio_work;

With these changes I was able to get iscsitarget-dkms to compile and install and it appears to work correctly.I used these commands to compile and install iscsitarget-dkms:
# dkms build -m iscsitarget -v 1.4.20.3+svn502
# dkms install -m iscsitarget -v 1.4.20.3+svn502
 I am not sure if these problems have been caused by the kernel sources required for my odroid U3 device.  I have only used those supplied and recommened for the device.However, I thought it could be a problem with the dkms.conf file in general affecting other systems and kernels.
I am using Debian Wheezy on odroidU3.# uname -a
Linux odroidu3 3.8.13-odroidu3 #3 SMP PREEMPT Mon Dec 15 18:10:46 AEST 2014 armv7l GNU/Linux# dpkg -s libc6 | grep ^Version
Version: 2.13-38+deb7u6

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20141215/a42e4616/attachment-0001.html>


More information about the Pkg-iscsi-maintainers mailing list