General NAS-Central Forums

Welcome to the NAS community
It is currently Wed Oct 18, 2017 5:34 am

All times are UTC




Post new topic Reply to topic  [ 69 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: iSCSI on a ZyXEL NAS?
PostPosted: Mon Oct 17, 2016 8:32 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Hi everyone!

I have a pxe system on my NAS, with pxelinux, tftp and nfs. I have several OS-es configured on it, So I Can boot up from all of my computers, which is attached to my network. And it is really cool, because if I need for example an openSUSE, I Can simply boot up a diskless system without installing it on the PC's hard drive (or ssd). Or, I have a lot of system rescue options, which Can repair any computer attached on my network. So it is awesome, I think, but with tftp it is a bit slow. And one more thing! I Cannot boot up a diskless Windows system. I read about initramfs creation from the win kernel, but I Couldn't do it.

So the only other way is the iSCSI. --> I have to configure an iSCSI server on my ZyXEL NSA320S. And for that, I downloaded the open-isns and I compiled it, after it, I tried to compile the open-isci... But it has got a simple makefile compiler, the configure script not exist in that source... And the source is written for linuxes, wihout /ffp prefix... I tried to change these paths in the Makefile, and I tried to compile it, but says this:

Code:
gcc -O2 -g -Wall -Wstrict-prototypes -I../include -I. -DLinux -DNETLINK_ISCSI=8 -D_GNU_SOURCE   -c -o actor.o actor.c
actor.c: In function 'actor_schedule_private':
actor.c:136:20: error: 'CLOCK_MONOTONIC_COARSE' undeclared (first use in this function)
  if (clock_gettime(CLOCK_MONOTONIC_COARSE, &tv)) {
                    ^
actor.c:136:20: note: each undeclared identifier is reported only once for each function it appears in
actor.c: In function 'actor_poll':
actor.c:224:20: error: 'CLOCK_MONOTONIC_COARSE' undeclared (first use in this function)
  if (clock_gettime(CLOCK_MONOTONIC_COARSE, &tv)) {
                    ^
actor.c:242:7: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'time_t' [-Wformat=]
       (long)thread, thread->ttschedule, time_left);
       ^
actor.c:255:6: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'time_t' [-Wformat=]
      current_time, pend_list.next, &pend_list);
      ^
<builtin>: recipe for target 'actor.o' failed
make[1]: *** [actor.o] Error 1
make[1]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/usr'
Makefile:41: recipe for target 'user' failed
make: *** [user] Error 2


It is weird for me... Is this source useable for this nas? I think, with a lot modify the answer is yes, but how? :)

Thanks!

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Mon Oct 17, 2016 9:18 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
CLOCK_MONOTONIC_COARSE is available since kernel 2.6.32
http://man7.org/linux/man-pages/man2/clock_gettime.2.html
Try to change to CLOCK_MONOTONIC.


Top
 Profile  
 
PostPosted: Tue Oct 18, 2016 4:40 am 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Okay, thanks, will try it!

Edit: Worked, nice! :) Many thanks!

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 4:31 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
I had to pause the compile of this source, because I am worked on a miniDLNA stock package. But now, it works, So I Can resume the process...

So, here is the next error after the monotonic clock:

Code:
cc -O2 -g -Wall -Wstrict-prototypes -I../include -I. -DLinux -DNETLINK_ISCSI=8 -D_GNU_SOURCE   -c -o mntcheck.o mntcheck.c
mntcheck.c: In function 'libmount_init':
mntcheck.c:66:2: warning: implicit declaration of function 'mnt_table_parse_swaps' [-Wimplicit-function-declaration]
  mnt_table_parse_swaps(swaps, NULL);
  ^
cc -O2 -g -Wall -Wstrict-prototypes -I../include -I. -DLinux -DNETLINK_ISCSI=8 -D_GNU_SOURCE  iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o transport.o iser.o cxgbi.o be2iscsi.o initiator_common.o iscsi_err.o flashnode.o uip_mgmt_ipc.o netlink.o ../utils/sysdeps/sysdeps.o initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o ../utils/fwparam_ibft/fw_entry.o ../utils/fwparam_ibft/fwparam_ppc.o ../utils/fwparam_ibft/fwparam_sysfs.o ../utils/fwparam_ibft/prom_lex.o ../utils/fwparam_ibft/prom_parse.tab.o strings.o discovery.o iscsid.o session_mgmt.o discoveryd.o mntcheck.o -o iscsid  -lisns -lcrypto -lrt -lmount
/usr/local/zy-pkgs/ffproot/ffp/bin/../lib/gcc/arm-ffp-linux-uclibcgnueabi/4.9.2/../../../libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
mntcheck.o: In function `libmount_init':
/i-data/bf835951/build/open-iscsi-2.0.874/usr/mntcheck.c:66: undefined reference to `mnt_table_parse_swaps'
collect2: error: ld returned 1 exit status
Makefile:57: recipe for target 'iscsid' failed
make[1]: *** [iscsid] Error 1
make[1]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/usr'
Makefile:41: recipe for target 'user' failed
make: *** [user] Error 2


It is a bug in libmount?

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 5:39 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
You have latest libmount version installed, don't you?
What tells you:
Code:
grep -R 'mnt_table_parse_swaps' /ffp/lib


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 7:04 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
I have s's util-linux package installed, who has libmount.

But now, I tried to compile, the latest version, see:

Code:
  CC       term-utils/scriptreplay.o
  CCLD     scriptreplay
term-utils/scriptreplay.o: In function `close_stream':
/i-data/bf835951/build/util-linux-2.29-rc2/./include/closestream.h:28: warning: This version of __fpending returns bytes remaining in buffer for both narrow and wide streams.  glibc's version returns wide chars in buffer for the wide stream case.
term-utils/scriptreplay.o: In function `getnum':
scriptreplay.c:(.text+0x1c0): undefined reference to `__isnan'
collect2: error: ld returned 1 exit status
Makefile:6366: recipe for target 'scriptreplay' failed
make[2]: *** [scriptreplay] Error 1
make[2]: Leaving directory '/i-data/bf835951/build/util-linux-2.29-rc2'
Makefile:11438: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/i-data/bf835951/build/util-linux-2.29-rc2'
Makefile:4769: recipe for target 'all' failed
make: *** [all] Error 2

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 7:23 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Paste
Code:
grep -R 'mnt_table_parse_swaps' /ffp/lib
output first.
Which uclibc version has you?

Last error indicates missing linking to math library of uclibc. (-lm)
Code:
readelf -a /ffp/lib/libm.so | grep -R '__isnan'
Quote:
71: 0000c364 32 FUNC GLOBAL DEFAULT 7 __isnan
80: 0000c384 20 FUNC GLOBAL DEFAULT 7 __isnanf


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 7:43 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Here it is:

Code:
grep: /ffp/lib/*: No such file or directory


And yes, nothing more...

And the second command's output:

Code:
    71: 0000c844    48 FUNC    GLOBAL DEFAULT    7 __isnan
    80: 0000c874    20 FUNC    GLOBAL DEFAULT    7 __isnanf


I have Your latest utf-8 supporting uClibc.

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Thu Oct 20, 2016 9:33 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Do you see difference between mine grep command and that one you give output?
Use LIBS='-lm' ./configure for util Linux.


Top
 Profile  
 
PostPosted: Fri Oct 21, 2016 4:40 am 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
barmalej2 wrote:
Do you see difference between mine grep command and that one you give output?


Sorry, no. i Can't find Your output... :oops:

Quote:
Use LIBS='-lm' ./configure for util Linux.


That waa my first try, when the error shown up. Tbe error is the same...

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Fri Oct 21, 2016 5:49 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
There is no mine output. I simply compared your output with mine command. This output can't be from it, because you didn't do as you been told to do.
util-linux builds fine for me without any mambo jambo tricks. I used the following configure options:
Code:
mkdir -pv ${BUILDDIR}/ffp/var/lib/hwclock
./configure ADJTIME_PATH=/ffp/var/lib/hwclock/adjtime \
   --prefix=/ffp \
   --disable-nls \
   --enable-partx \
   --enable-write \
   --enable-libuuid \
   --enable-libblkid \
   --enable-libmount-force-mountinfo \
   --without-systemd \
   --without-systemdsystemunitdir \
   --without-udev \
   --without-python \
   --disable-use-tty-group


Top
 Profile  
 
PostPosted: Fri Oct 21, 2016 7:24 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Still the same... :evil:

But! This configure flag: "enable-libmount-force-mountinfo" not exist at the source, I am using now. So it looks like, You used an other source. Which one?

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Fri Oct 21, 2016 8:03 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
Latest stable of course.
https://www.kernel.org/pub/linux/utils/util-linux/v2.28/util-linux-2.28.2.tar.xz


Top
 Profile  
 
PostPosted: Sat Oct 22, 2016 6:30 am 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Nice! We found the culprit. I used a beta version.

But now, the open iscsi gives me an undefined reference to fmemopen error... I think the fmemopen is glibc specific...

Code:
/ffp/bin/sh ../../libtool  --tag=CC   --mode=link gcc -I../../src/uip -I../../src/apps/brcm-iscsi -I../../src/apps/dhcpc -I../../src/unix/libs -I../../../include -I../../../usr  -DBYTE_ORDER=LITTLE -g -O2 -Wall  -ldl -rdynamic  -lpthread  -o iscsiuio iscsiuio-build_date.o iscsiuio-main.o iscsiuio-clock-arch.o iscsiuio-logger.o iscsiuio-nic.o iscsiuio-nic_id.o iscsiuio-nic_vlan.o iscsiuio-nic_nl.o iscsiuio-nic_utils.o iscsiuio-packet.o iscsiuio-iscsid_ipc.o iscsiuio-ping.o ../../src/uip/lib_iscsi_uip.a ../../src/apps/dhcpc/lib_apps_dhcpc.a ../../src/apps/brcm-iscsi/lib_apps_brcm_iscsi.a ../../src/unix/libs/lib_iscsiuio_hw_cnic.a
libtool: link: gcc -I../../src/uip -I../../src/apps/brcm-iscsi -I../../src/apps/dhcpc -I../../src/unix/libs -I../../../include -I../../../usr -DBYTE_ORDER=LITTLE -g -O2 -Wall -rdynamic -o iscsiuio iscsiuio-build_date.o iscsiuio-main.o iscsiuio-clock-arch.o iscsiuio-logger.o iscsiuio-nic.o iscsiuio-nic_id.o iscsiuio-nic_vlan.o iscsiuio-nic_nl.o iscsiuio-nic_utils.o iscsiuio-packet.o iscsiuio-iscsid_ipc.o iscsiuio-ping.o  -ldl -lpthread ../../src/uip/lib_iscsi_uip.a ../../src/apps/dhcpc/lib_apps_dhcpc.a ../../src/apps/brcm-iscsi/lib_apps_brcm_iscsi.a ../../src/unix/libs/lib_iscsiuio_hw_cnic.a
iscsiuio-nic_vlan.o: In function `parse_vlan_table':
/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio/src/unix/nic_vlan.c:167: undefined reference to `fmemopen'
iscsiuio-nic_utils.o: In function `dump_packet_to_log':
/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio/src/unix/nic_utils.c:1538: undefined reference to `fmemopen'
collect2: error: ld returned 1 exit status
Makefile:455: recipe for target 'iscsiuio' failed
make[5]: *** [iscsiuio] Error 1
make[5]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio/src/unix'
Makefile:679: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio/src/unix'
Makefile:335: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio/src'
Makefile:385: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio'
Makefile:316: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/i-data/bf835951/build/open-iscsi-2.0.874/iscsiuio'
Makefile:41: recipe for target 'user' failed
make: *** [user] Error 2

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Sat Oct 22, 2016 9:03 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2303
MrDini wrote:
Nice! We found the culprit. I used a beta version.

I don't think so, because I can build, but you can't. Unless you doing something differently again.

MrDini wrote:
But now, the open iscsi gives me an undefined reference to fmemopen error... I think the fmemopen is glibc specific...

You can think whatever you want, but that doesn't make you right:
Code:
grep -R 'fmemopen' /ffp/lib
Quote:
Binary file /ffp/lib/libc.so.0 matches
Binary file /ffp/lib/libc.a matches
Binary file /ffp/lib/libc_pic.a matches
Binary file /ffp/lib/libuClibc-0.9.33.3-git.so matches

Code:
readelf -a /ffp/lib/libc.so.0 | grep 'fmemopen'
Quote:
384: 00031738 268 FUNC GLOBAL DEFAULT 7 fmemopen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 69 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 42 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group