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

Asked by Garrett Fields

Using the method described here:

sudo apt-get install iscsitarget-source
sudo module-assistant
   --> Select iscsitarget

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:

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

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

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

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

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>


#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.