iscsitarget-1.4.20.2 issues during make command

Issues related to configuring your network

iscsitarget-1.4.20.2 issues during make command

Postby junix88 » 2012/05/17 22:57:53

Hello there,

I'm new to linux and I do really need steps-how-to-Fix regarding issues I encountered during kernel module compilation of iscsitarget-1.4.20.2 (can not use scsi-target-utils as an option because openQRM uses only the iscsitarget the 3rd party package). After I extracted the tar files and cd to /usr/src/local/iscsitarget-1.4.20.2. I issued command as follows:

[root@thesisQRMproject iscsitarget-1.4.20.2]# make
cc: /lib/modules/2.6.32-131.21.1.el6.x86_64/build/include/linux/version.h: No such file or directory
cc: no input files
/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: [: -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 `/usr/src/local/iscsitarget-1.4.20.2/usr'
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ietd.o ietd.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o iscsid.o iscsid.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o conn.o conn.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o session.o session.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o target.o target.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o message.o message.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ctldev.o ctldev.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o log.o log.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o chap.o chap.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o event.o event.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o param.o param.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o plain.o plain.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o isns.o isns.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o md5.o md5.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o sha1.o sha1.c
cc ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o md5.o sha1.o -o ietd
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ietadm.o ietadm.c
cc ietadm.o param.o -o ietadm
make[1]: Leaving directory `/usr/src/local/iscsitarget-1.4.20.2/usr'
make -C /lib/modules/2.6.32-131.21.1.el6.x86_64/build SUBDIRS=/usr/src/local/iscsitarget-1.4.20.2/kernel modules
make: *** /lib/modules/2.6.32-131.21.1.el6.x86_64/build: No such file or directory. Stop.
make: *** [kernel] Error 2

UNFORTUNATELY, there was errors as shown above. Tried the following commands to confirm files not in the directory as shown above:

[root@thesisQRMproject iscsitarget-1.4.20.2]# find /lib/modules/`uname -r` -name version.h
[root@thesisQRMproject iscsitarget-1.4.20.2]#
[root@thesisQRMproject iscsitarget-1.4.20.2]# find /lib/modules/`uname -r` -name build
/lib/modules/2.6.32-131.21.1.el6.x86_64/build

version.h file confirmed that it was not existed in the directory BUT /lib/modules/2.6.32-131.21.1.el6.x86_64/build was being found.

Any help is very much appreciated.

Thank you.
junix88
 
Posts: 8
Joined: 2012/05/17 22:32:24

iscsitarget-1.4.20.2 issues during make command

Postby toracat » 2012/05/17 23:20:03

First, please do not run make as root.

Second, to build a kernel module, try following the CentOS wiki Build Your Own Kernel Modules. I would suggest you start with method 1.
User avatar
toracat
Forum Moderator
 
Posts: 6695
Joined: 2006/09/03 16:37:24
Location: California, US

Re: iscsitarget-1.4.20.2 issues during make command

Postby TrevorH » 2012/05/17 23:59:08

And just to add to your woes, might want to run `yum update` first since you appear to be building against the CentOS 6.1 kernel and 6.2 has been out for some months.
User avatar
TrevorH
Forum Moderator
 
Posts: 9147
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: iscsitarget-1.4.20.2 issues during make command

Postby lcdchiong » 2012/05/18 02:35:02

@Toracat & TrevorH,

Thanks much for the mentoring kind of advice, and for a quick reply.

I'll try it tomorrow.

Kind regards,

junix
lcdchiong
 
Posts: 1
Joined: 2012/05/17 22:29:19

Re: iscsitarget-1.4.20.2 issues during make command

Postby junix88 » 2012/05/28 22:08:54

Hello guyz,

Just got back from illness. By the way, @ TrevorH I already updated my yum BUT still error persisted.

@ Toracat just need your guidance, reading the link you've provided I'm confuse where and how to go to

~/rpmbuild/BUILD/kernel-../linux-.. directory

Because when I tried to cd to ../BUILD dir there's no such dir as shown:

[junix@thesisQRMproject]$ cd /~rpmbuild/BUILD/
bash: cd: /~rpmbuild/BUILD/: No such file or directory

I tried to install rpm-build BUT still there's no such dir.
$ rpm -qa | grep rpm-build
rpm-build-4.8.0-19.el6_2.1.x86_64

Do we still have to create this dir for the purpose? or it will automatically created itself?

additional info you might need to know:

[junix@thesisQRMproject]$ ll /lib/modules/
total 8
drwxr-xr-x 7 junix root 4096 May 28 10:00 2.6.32-220.17.1.el6.x86_64
drwxr-xr-x 7 junix root 4096 May 28 15:10 2.6.32-71.el6.x86_64

$ rpm -qa | grep kernel
kernel-devel-2.6.32-220.17.1.el6.x86_64
kernel-2.6.32-71.el6.x86_64
kernel-headers-2.6.32-220.17.1.el6.x86_64
dracut-kernel-004-256.el6_2.1.noarch
kernel-firmware-2.6.32-220.17.1.el6.noarch
kernel-2.6.32-220.17.1.el6.x86_64

[junix@thesisQRMproject]$ rpm -qa | grep gcc
libgcc-4.4.6-3.el6.x86_64
gcc-c++-4.4.6-3.el6.x86_64
gcc-gfortran-4.4.6-3.el6.x86_64
gcc-4.4.6-3.el6.x86_64

[junix@isocabinet 1.4.20]$ ls -l
total 128
-rw-r--r-- 1 junix root 19293 May 23 2011 ChangeLog
-rw-r--r-- 1 junix root 18010 Apr 25 2010 COPYING
-rw-r--r-- 1 junix root 2078 Mar 16 2011 dkms.conf
drwxr-xr-x 3 junix root 4096 Mar 20 2011 doc
drwxr-xr-x 3 junix root 4096 Mar 20 2011 etc
drwxr-xr-x 2 junix root 4096 Mar 16 2011 include
-rw-r--r-- 1 junix root 13578 Mar 16 2011 iscsitarget.spec
drwxrwxrwx 2 junix root 4096 Mar 22 15:25 kernel
-rw-r--r-- 1 junix root 10562 Sep 3 2011 Makefile
drwxr-xr-x 2 junix root 4096 May 23 2011 patches
-rw-r--r-- 1 junix root 5870 Apr 25 2010 README
-rw-r--r-- 1 junix root 1203 Apr 25 2010 README.initiators
-rw-r--r-- 1 junix root 1494 Apr 25 2010 README.mcs
-rw-r--r-- 1 junix root 2481 Apr 25 2010 README.vmware
-rw-r--r-- 1 junix root 9038 May 23 2011 RELEASE_NOTES
drwxr-xr-x 2 junix root 4096 May 28 16:28 usr

In the list of aboved-files I noticed the "dkms.conf" which I found in the link you've provided building a kernel using DKMS. Below is the the content of the config file, as shown:

[junix@isocabinet 1.4.20]$ cat dkms.conf
#
# Master copy of dkms.conf for iscsitarget
#

PACKAGE_NAME="iscsitarget"
PACKAGE_VERSION="1.4.20.3"
MOD_PATH=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}

BUILT_MODULE_NAME="iscsi_trgt"
BUILT_MODULE_LOCATION="kernel"
DEST_MODULE_LOCATION="/kernel/iscsi"

MAKE="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/kernel modules"

CLEAN="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/kernel clean"

AUTOINSTALL="yes"

#
# Patches newest - oldest, distro spec at bottom
#

PATCH[0]="compat-2.6.36-2.6.37.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)"

PATCH[1]="compat-2.6.33-2.6.35.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)"

PATCH[2]="compat-2.6.32.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)"

PATCH[3]="compat-2.6.31.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)"

PATCH[4]="compat-2.6.30.patch"
PATCH_MATCH[4]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30)"

PATCH[5]="compat-2.6.29.patch"
PATCH_MATCH[5]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29)"

PATCH[6]="compat-2.6.28.patch"
PATCH_MATCH[6]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28)"

PATCH[7]="compat-2.6.25-2.6.27.patch"
PATCH_MATCH[7]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27)"

PATCH[8]="compat-2.6.24.patch"
PATCH_MATCH[8]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24)"

PATCH[9]="compat-2.6.23.patch"
PATCH_MATCH[9]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23)"

PATCH[10]="compat-2.6.22.patch"
PATCH_MATCH[10]="2\.6\.(9|14|15|16|17|18|19|20|21|22)"

PATCH[11]="compat-2.6.19-2.6.21.patch"
PATCH_MATCH[11]="2\.6\.(9|14|15|16|17|18|19|20|21)"

PATCH[12]="compat-2.6.14-2.6.18.patch"
PATCH_MATCH[12]="2\.6\.(9|14|15|16|17|18)"

PATCH[13]="compat-sles10sp2.patch"
PATCH_MATCH[13]="2\.6\.16\.60-.*"

PATCH[14]="compat-rhel4.patch"
PATCH_MATCH[14]="2\.6\.9-.*\.(el|plus\.c4)"

Thanks in advance for your help. :-)

Junix
junix88
 
Posts: 8
Joined: 2012/05/17 22:32:24

Re: iscsitarget-1.4.20.2 issues during make command

Postby pschaff » 2012/05/29 11:12:53

junix88 wrote:
...
[junix@thesisQRMproject]$ cd [color=ff0000]/[/color]~rpmbuild/BUILD/
bash: cd: [color=ff0000]/[/color]~rpmbuild/BUILD/: No such file or directory
...

The leading [color=ff0000]/[/color] is the problem there. What does
Code: Select all
ls -lF ~/rpmbuild
show?
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: iscsitarget-1.4.20.2 issues during make command

Postby junix88 » 2012/05/29 14:16:26

Hi,

Below is the output when I typed this command "ls -lF ~rpmbuild" as shows:

[junix@thesisQRMproject]$ ls -lF ~rpmbuild
ls: cannot access ~rpmbuild: No such file or directory

Do hope you can guide me how to fix the issues.

Regards,

Junix
junix88
 
Posts: 8
Joined: 2012/05/17 22:32:24

Re: iscsitarget-1.4.20.2 issues during make command

Postby pschaff » 2012/05/29 15:02:07

My error - fixed above, but that should have been
Code: Select all
ls -lF ~/rpmbuild
Went from too many slashes to too few.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: iscsitarget-1.4.20.2 issues during make command

Postby junix88 » 2012/05/29 19:43:26

Hello Phil,

Kindly check below as shown -

login as a regular user -

[junix@thesisQRMproject iscsitarget]$ ls -lF ~/rpmbuild
ls: cannot access /home/junix/rpmbuild: No such file or directory
[junix@thesisQRMproject iscsitarget]$

log on as a root -

[root@thesisQRMproject ~]# ls -lF ~/rpmbuild
ls: cannot access /root/rpmbuild: No such file or directory

Thanks
junix88
 
Posts: 8
Joined: 2012/05/17 22:32:24

Re: iscsitarget-1.4.20.2 issues during make command

Postby toracat » 2012/05/29 20:06:28

junix88 wrote:

I tried to install rpm-build BUT still there's no such dir.
$ rpm -qa | grep rpm-build
rpm-build-4.8.0-19.el6_2.1.x86_64

Do we still have to create this dir for the purpose? or it will automatically created itself?

The kernel module wiki article refers to the Kernel_Source wiki page. I suppose you have read Section 2 of that wiki as this is a required step. It says:
As an ordinary user, not root, create a directory tree based on ~/rpmbuild:

[user@host]$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
[user@host]$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros


The first command creates 6 subdirectories including BUILD.
User avatar
toracat
Forum Moderator
 
Posts: 6695
Joined: 2006/09/03 16:37:24
Location: California, US

Next

Return to CentOS 6 - Networking Support

Who is online

Users browsing this forum: No registered users and 4 guests