LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-31-2010, 05:08 AM   #1
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Rep: Reputation: 0
SCSI target - unable to build scsi_trgt module


Hello, I'm not sure whether my problem should be located in the "kernel" section, so I apologize in advance if I put it in a wrong place.
I'm trying to get to work pNFS with block layout and to accomplish it, I also need an SCSI target (I'm following this short how-to: http://wiki.linux-nfs.org/wiki/index...p_Instructions). I installed the iscsitarget package but it gave me a warning that the scsi target daemon couldn't be started. I tried to start it manually and found out (from the error message) that kernel module scsi_trgt is missing. So I installed iscsitarget-source and tried to compile it using module-assistant: m-a a-i iscsitarget which gave me the following errors:

Code:
dh_clean
/usr/bin/make -C /usr/src/linux-OLDVERSION.1269977161 SUBDIRS=/usr/src/modules/iscsitarget/kernel clean
make[1]: Entering directory `/usr/src/linux-OLDVERSION.1269976362'
  CLEAN   /usr/src/modules/iscsitarget/kernel/.tmp_versions
make[1]: Leaving directory `/usr/src/linux-OLDVERSION.1269976362'
hostname: Unknown host
/usr/bin/make  -f debian/rules kdist_clean kdist_config binary-modules
hostname: Unknown host
make[1]: Entering directory `/usr/src/modules/iscsitarget'
dh_clean
/usr/bin/make -C /usr/src/linux-OLDVERSION.1269977161 SUBDIRS=/usr/src/modules/iscsitarget/kernel clean
make[2]: Entering directory `/usr/src/linux-OLDVERSION.1269976362'
make[2]: Leaving directory `/usr/src/linux-OLDVERSION.1269976362'
for templ in /usr/src/modules/iscsitarget/debian/iscsitarget-module-_KVERS_.postinst; do \
    cp $templ `echo $templ | sed -e 's/_KVERS_/2.6.33-rc6-pnfs-dist/g'` ; \
  done
for templ in `ls debian/*.modules.in` ; do \
    test -e ${templ%.modules.in}.backup || cp ${templ%.modules.in} ${templ%.modules.in}.backup 2>/dev/null || true; \
    sed -e 's/##KVERS##/2.6.33-rc6-pnfs-dist/g ;s/#KVERS#/2.6.33-rc6-pnfs-dist/g ; s/_KVERS_/2.6.33-rc6-pnfs-dist/g ; s/##KDREV##//g ; s/#KDREV#//g ; s/_KDREV_//g  ' < $templ > ${templ%.modules.in}; \
  done
dh_testdir
dh_testroot
dh_clean -k
#/usr/bin/make -C /usr/src/linux-OLDVERSION.1269977161 KERNEL_SOURCES=/usr/src/linux-OLDVERSION.1269977161 MODVERSIONS=detect KERNEL=linux-2.6.33-rc6-pnfs-dist KDIR=/usr/src/linux-OLDVERSION.1269977161 SUBDIRS=/usr/src/modules/iscsitarget/kernel modules
/usr/bin/make -C /usr/src/linux-OLDVERSION.1269977161 SUBDIRS=/usr/src/modules/iscsitarget/kernel modules
make[2]: Entering directory `/usr/src/linux-OLDVERSION.1269976362'
  CC [M]  /usr/src/modules/iscsitarget/kernel/tio.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/iscsi.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/nthread.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/wthread.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/config.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/digest.o
  CC [M]  /usr/src/modules/iscsitarget/kernel/conn.o
/usr/src/modules/iscsitarget/kernel/conn.c: In function ‘conn_info_show’:
/usr/src/modules/iscsitarget/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/usr/src/modules/iscsitarget/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/usr/src/modules/iscsitarget/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/usr/src/modules/iscsitarget/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
make[3]: *** [/usr/src/modules/iscsitarget/kernel/conn.o] Error 1
make[2]: *** [_module_/usr/src/modules/iscsitarget/kernel] Error 2
make[2]: Leaving directory `/usr/src/linux-OLDVERSION.1269976362'
make[1]: *** [binary-modules] Error 2
make[1]: Leaving directory `/usr/src/modules/iscsitarget'
make: *** [kdist_build] Error 2
I thought it was caused by an old version of the module source and quite a new kernel (2.6.33-rc6 with pNFS patch), so I got the newest source from the developers http://sourceforge.net/projects/iscs...ar.gz/download and tried to compile it, however I ended up facing the same problem (and there's a strange problem with syntactic errors in the Makefile - just at the beginning of the "make" output - but I was unable to find out why they appeared):
Code:
ds:~/iscsitarget-1.4.19# make
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -lt: unary operator expected
make -C usr
make[1]: Entering directory `/root/iscsitarget-1.4.19/usr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/iscsitarget-1.4.19/usr'
make -C /lib/modules/2.6.33-rc6-pnfs-dist/build SUBDIRS=/root/iscsitarget-1.4.19/kernel modules
make[1]: Entering directory `/usr/src/linux-2.6.33-rc6-pnfs-dist'
  CC [M]  /root/iscsitarget-1.4.19/kernel/tio.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/iscsi.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/nthread.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/wthread.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/config.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/digest.o
  CC [M]  /root/iscsitarget-1.4.19/kernel/conn.o
/root/iscsitarget-1.4.19/kernel/conn.c: In function ‘conn_info_show’:
/root/iscsitarget-1.4.19/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/root/iscsitarget-1.4.19/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/root/iscsitarget-1.4.19/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
/root/iscsitarget-1.4.19/kernel/conn.c:46: error: ‘struct inet_sock’ has no member named ‘daddr’
make[2]: *** [/root/iscsitarget-1.4.19/kernel/conn.o] Error 1
make[1]: *** [_module_/root/iscsitarget-1.4.19/kernel] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.33-rc6-pnfs-dist'
make: *** [kernel] Error 2
Under normal circumstances I would just use a kernel and iscsi_trgt module from a package but since I need the new kernel because of pNFS, I don't know at all how to solve that. Thanks very much for any hint.
 
Old 04-03-2010, 04:50 AM   #2
codedr
Member
 
Registered: Feb 2007
Location: USA
Distribution: opensuse, slackware
Posts: 35

Rep: Reputation: 19
Find out where inet_sock is declared
I prefer cscope for finding decls in a large project, but find works well.
cd /usr/src/linux
find . -type f | egrep '\.h$' | xargs egrep inet_sock
>> ./include/net/inet_sock.h: struct inet_sock

Goto kernel.org
If it's a recent kernel, it will be listed.
2.6.33.2 (today) is listed as a stable release
. click the gitweb option
. follow the tree to include/net/inet_sock.h
. start with the most recent change 'inet rename some inet_sock fields'
. look at the commitdiff
. search for daddr
- psum = csum_tcpudp_nofold(inet->saddr, inet->daddr, ulen,
+ psum = csum_tcpudp_nofold(inet->inet_saddr, inet->inet_daddr, ulen,
. daddr has been renamed inet_daddr

Patch your code.
Test compile your code.
Test the code.

The change might be in the svn developer view of iscsitarget.

If not, help save the world, submit your patch to iscsitarget.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to build the vmmon module. malickhat Linux - Virtualization and Cloud 4 12-14-2009 12:26 AM
Unable to build the nvidia kernel module ROXR Slackware 2 01-07-2009 04:20 PM
Unable to build the NVIDIA kernel module. jarred Linux - Newbie 5 03-20-2007 01:15 AM
Unable to build nvidia module martincho Linux - Hardware 3 05-21-2005 07:49 PM
Unable to build the NVIDIA kernel module subaruwrx Linux - General 2 03-12-2005 08:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration