tgt: iSCSI target support

This is a port from old packages repo with the following improvements:
- allow to select multiple addresses and ports to listent to
- support both address- and name-based ACLs
  (note: config option has been changed from "allow" to "allow_address", "allow_name")
- support more optionf for LUNs
- support various device types (disk, cd, sg passthrough)
- bind accounts to multiple targets
- use uci_validate_section in the init script
- improve error reporting, use logger instead of echo
- set number of IO threads to 2 by default (affects memory footprint)
- configure keepalive
- update to 1.0.48

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
This commit is contained in:
Maxim Storchak
2014-06-11 08:42:27 +03:00
parent a27c76ba56
commit bd5ac374f6
6 changed files with 285 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
--- tgt-1.0.42/usr/util.h.orig 2013-12-26 16:18:54.000000000 +0200
+++ tgt-1.0.42/usr/util.h 2013-12-26 16:19:10.000000000 +0200
@@ -212,11 +212,6 @@
*/
static inline int unmap_file_region(int fd, off_t offset, off_t length)
{
-#ifdef FALLOC_FL_PUNCH_HOLE
- if (fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
- offset, length) == 0)
- return 0;
-#endif
return -1;
}
+56
View File
@@ -0,0 +1,56 @@
--- tgt-1.0.46.orig/usr/Makefile 2014-04-06 09:55:49.000000000 +0300
+++ tgt-1.0.46/usr/Makefile 2014-04-06 09:57:04.000000000 +0300
@@ -1,13 +1,13 @@
sbindir ?= $(PREFIX)/sbin
libdir ?= $(PREFIX)/lib/tgt
-ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
+#ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
CFLAGS += -DUSE_SIGNALFD
-endif
+#endif
-ifneq ($(shell test -e /usr/include/sys/timerfd.h && echo 1),)
+#ifneq ($(shell test -e /usr/include/sys/timerfd.h && echo 1),)
CFLAGS += -DUSE_TIMERFD
-endif
+#endif
TGTD_OBJS += $(addprefix iscsi/, conn.o param.o session.o \
iscsid.o target.o chap.o sha1.o md5.o transport.o iscsi_tcp.o \
@@ -21,8 +21,9 @@
MODULES += bs_glfs.so
endif
-ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e /usr/include/libaio.h && echo 1),)
-CFLAGS += -DUSE_EVENTFD
+#ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e $(STAGING_DIR)/usr/include/libaio.h && echo 1),)
+ifneq ((test -e $(STAGING_DIR)/usr/include/libaio.h && echo 1),)
+CFLAGS += -DUSE_EVENTFD -I$(STAGING_DIR)/usr/include/
TGTD_OBJS += bs_aio.o
LIBS += -laio
endif
@@ -47,7 +48,7 @@
LIBS += -lpthread -ldl
-PROGRAMS += tgtd tgtadm tgtimg
+PROGRAMS += tgtd tgtadm
TGTD_OBJS += tgtd.o mgmt.o target.o scsi.o log.o driver.o util.o work.o \
concat_buf.o parser.o spc.o sbc.o mmc.o osd.o scc.o smc.o \
ssc.o libssc.o bs_rdwr.o bs_ssc.o \
@@ -74,14 +75,8 @@
-include $(TGTADM_DEP)
-TGTIMG_OBJS = tgtimg.o libssc.o libcrc32c.o
TGTIMG_DEP = $(TGTIMG_OBJS:.o=.d)
-tgtimg: $(TGTIMG_OBJS)
- $(CC) $^ -o $@
-
--include $(TGTIMG_DEP)
-
%.o: %.c
$(CC) -c $(CFLAGS) $*.c -o $*.o
@$(CC) -MM $(CFLAGS) -MF $*.d -MT $*.o $*.c
+11
View File
@@ -0,0 +1,11 @@
--- tgt-1.0.46.orig/Makefile 2014-04-06 09:55:49.000000000 +0300
+++ tgt-1.0.46/Makefile 2014-04-06 09:57:04.000000000 +0300
@@ -63,7 +63,7 @@
$(MAKE) -C conf clean
.PHONY: install
-install: install-programs install-doc install-conf install-scripts
+install: install-programs
.PHONY: rpm
rpm: