Unable to compile iscsitarget-source 0.4.15+svn148-2.1ubuntu2 on Intrepid

Asked by Garrett Fields

Using the method described here:
https://bugs.launchpad.net/ubuntu/+source/iscsitarget/+bug/145539

sudo apt-get install iscsitarget-source
sudo module-assistant
*prepare*
*select*
   --> Select iscsitarget
*build*

I got message:
In file included from/usr/src/modules/iscsitarget/kernel/block-io.c:12:
include/linux/parser.h:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘match_strlcpy’

Also reported here:
http://www.nabble.com/iscsitarget-0.4.16-with-2.6.26-kernel--td19276359.html

According to that thread, this problem also exists in 0.4.16 for these users, but possibly a newer svn build might fix this.

Can anyone else confirm my errors in intrepid? Is there a alternative/better way to build? Is this my error or a bug?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu iscsitarget Edit question
Assignee:
No assignee Edit question
Solved by:
Garrett Fields
Solved:
Last query:
Last reply:
Revision history for this message
Garrett Fields (fields-g) said :
#1

BTW... my kernel is 2.6.27-7-generic

Revision history for this message
Garrett Fields (fields-g) said :
#2

I fixed this issue. It is an easy fix once I figured out what was going on. I looked at the current SVN for my inspiration.

I suggest someone send upload a modified iscsitarget-source file with the following fix:
in /modules/iscsitarget/kernel/block-io.c,

I replaced:

#include <linux/parser.h>
#include <linux/blkdev.h>
#include <linux/buffer_head.h>

with

#include <linux/types.h>
#include <linux/blkdev.h>
#include <linux/parser.h>
#include <linux/buffer_head.h>

According to a thread above, the location of parser.h was important. The additional types.h didn't seem to hurt either. Finding this would have been much quicker, but I didn't realize that the source was being unpacked from the bz2 file every time a build was attempted. My attempts to fix this was being overwritten until I modified the bz2 file. Anyway, hope this helps someone in the meantime until this can be fixed in the repository.