iSCSI on a ZyXEL NAS?

Marvell Kirkwood based
User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

iSCSI on a ZyXEL NAS?

Post by MrDini » Mon Oct 17, 2016 8:32 pm

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: Select all

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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Mon Oct 17, 2016 9:18 pm

CLOCK_MONOTONIC_COARSE is available since kernel 2.6.32
http://man7.org/linux/man-pages/man2/cl ... ime.2.html
Try to change to CLOCK_MONOTONIC.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Tue Oct 18, 2016 4:40 am

Okay, thanks, will try it!

Edit: Worked, nice! :) Many thanks!
Thanks nas-central the lot of help! :)

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Thu Oct 20, 2016 4:31 pm

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: Select all

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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Thu Oct 20, 2016 5:39 pm

You have latest libmount version installed, don't you?
What tells you:

Code: Select all

grep -R 'mnt_table_parse_swaps' /ffp/lib

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Thu Oct 20, 2016 7:04 pm

I have s's util-linux package installed, who has libmount.

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

Code: Select all

  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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Thu Oct 20, 2016 7:23 pm

Paste

Code: Select all

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: Select all

readelf -a /ffp/lib/libm.so | grep -R '__isnan'
71: 0000c364 32 FUNC GLOBAL DEFAULT 7 __isnan
80: 0000c384 20 FUNC GLOBAL DEFAULT 7 __isnanf

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Thu Oct 20, 2016 7:43 pm

Here it is:

Code: Select all

grep: /ffp/lib/*: No such file or directory
And yes, nothing more...

And the second command's output:

Code: Select all

    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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Thu Oct 20, 2016 9:33 pm

Do you see difference between mine grep command and that one you give output?
Use LIBS='-lm' ./configure for util Linux.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Fri Oct 21, 2016 4:40 am

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:
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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Fri Oct 21, 2016 5:49 pm

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: Select all

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

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Fri Oct 21, 2016 7:24 pm

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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Fri Oct 21, 2016 8:03 pm


User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: iSCSI on a ZyXEL NAS?

Post by MrDini » Sat Oct 22, 2016 6:30 am

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: Select all

/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! :)

barmalej2
Posts: 2382
Joined: Sun Apr 29, 2012 5:24 pm

Re: iSCSI on a ZyXEL NAS?

Post by barmalej2 » Sat Oct 22, 2016 9:03 am

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: Select all

grep -R 'fmemopen' /ffp/lib
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: Select all

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

Post Reply