All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/open-iscsi: new package
@ 2022-09-26 15:43 TIAN Yuanhao
  2022-09-26 16:27 ` Thomas Petazzoni via buildroot
  2022-10-09 11:14 ` [Buildroot] [PATCH v2 " TIAN Yuanhao
  0 siblings, 2 replies; 4+ messages in thread
From: TIAN Yuanhao @ 2022-09-26 15:43 UTC (permalink / raw)
  To: buildroot; +Cc: TIAN Yuanhao, Thomas Petazzoni

Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/open-iscsi/Config.in       | 38 +++++++++++++++++
 package/open-iscsi/open-iscsi.hash |  3 ++
 package/open-iscsi/open-iscsi.mk   | 68 ++++++++++++++++++++++++++++++
 5 files changed, 111 insertions(+)
 create mode 100644 package/open-iscsi/Config.in
 create mode 100644 package/open-iscsi/open-iscsi.hash
 create mode 100644 package/open-iscsi/open-iscsi.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 54216450f4..7a698c31c0 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2791,6 +2791,7 @@ N:	Sven Oliver Moll <svolli@svolli.de>
 F:	package/most/
 
 N:	TIAN Yuanhao <tianyuanhao3@163.com>
+F:	package/open-iscsi/
 F:	package/open-isns/
 
 N:	Theo Debrouwere <t.debrouwere@televic.com>
diff --git a/package/Config.in b/package/Config.in
index de51be400b..dacc317132 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2357,6 +2357,7 @@ endif
 	source "package/odhcp6c/Config.in"
 	source "package/odhcploc/Config.in"
 	source "package/olsr/Config.in"
+	source "package/open-iscsi/Config.in"
 	source "package/open-lldp/Config.in"
 	source "package/open-plc-utils/Config.in"
 	source "package/openntpd/Config.in"
diff --git a/package/open-iscsi/Config.in b/package/open-iscsi/Config.in
new file mode 100644
index 0000000000..b13c518439
--- /dev/null
+++ b/package/open-iscsi/Config.in
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_OPEN_ISCSI
+	bool "open-iscsi"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_TOOLCHAIN_HAS_THREADS # pthread
+	depends on !BR2_STATIC_LIBS # kmod
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_OPEN_ISCSI_ISCSISTART \
+		if !BR2_PACKAGE_OPEN_ISCSI_ISCSID
+	select BR2_PACKAGE_KMOD
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_LIBS
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	help
+	  iSCSI tools for Linux.
+
+	  https://www.open-iscsi.com
+
+if BR2_PACKAGE_OPEN_ISCSI
+
+config BR2_PACKAGE_OPEN_ISCSI_ISCSID
+	bool "iscsid"
+	default y
+	select BR2_PACKAGE_OPEN_ISNS
+	help
+	  iscsid implements the control path of iSCSI protocol, plus
+	  some management facilities.
+
+config BR2_PACKAGE_OPEN_ISCSI_ISCSISTART
+	bool "iscsistart"
+	help
+	  iscsistart is used for attaching to iSCSI targets during
+	  bootup.
+
+endif
+
+comment "open-iscsi needs a toolchain w/ threads, dynamic library"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
diff --git a/package/open-iscsi/open-iscsi.hash b/package/open-iscsi/open-iscsi.hash
new file mode 100644
index 0000000000..ee6b0d41ce
--- /dev/null
+++ b/package/open-iscsi/open-iscsi.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  f5d038583657030345711d50b6d8095a0f2da5076bfe7035d64a2beba53405e8  open-iscsi-f633c09a7a2976069b1dfd98d9979349e92c38b5.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/open-iscsi/open-iscsi.mk b/package/open-iscsi/open-iscsi.mk
new file mode 100644
index 0000000000..d777101824
--- /dev/null
+++ b/package/open-iscsi/open-iscsi.mk
@@ -0,0 +1,68 @@
+################################################################################
+#
+# open-iscsi
+#
+################################################################################
+
+OPEN_ISCSI_VERSION = f633c09a7a2976069b1dfd98d9979349e92c38b5
+OPEN_ISCSI_SITE = $(call github,open-iscsi,open-iscsi,$(OPEN_ISCSI_VERSION))
+OPEN_ISCSI_LICENSE = GPL-2.0+
+OPEN_ISCSI_LICENSE_FILES = COPYING
+OPEN_ISCSI_DEPENDENCIES = kmod openssl util-linux-libs
+
+OPEN_ISCSI_CONF_OPTS = -Ddbroot=/var/lib/iscsi
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+OPEN_ISCSI_DEPENDENCIES += systemd
+OPEN_ISCSI_CONF_OPTS += -Dno_systemd=false
+else
+OPEN_ISCSI_CONF_OPTS += -Dno_systemd=true
+endif
+
+ifeq ($(BR2_PACKAGE_OPEN_ISNS),)
+define OPEN_ISCSI_DISABLE_ISNS
+	$(SED) "/'isns'/s/^/#/" $(@D)/meson.build
+	$(SED) "/'iscsid'/s/^/#/" $(@D)/usr/meson.build
+	$(SED) "/'iscsiadm'/s/^/#/" $(@D)/usr/meson.build
+endef
+OPEN_ISCSI_PRE_CONFIGURE_HOOKS += OPEN_ISCSI_DISABLE_ISNS
+else
+OPEN_ISCSI_DEPENDENCIES += open-isns
+endif
+
+define OPEN_ISCSI_INSTALL_TARGET_CMDS
+	$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/lib
+	cp -dpf $(@D)/build/libopeniscsiusr.so{,.0,.0.2.0} \
+		$(TARGET_DIR)/usr/lib/
+	$(OPEN_ISCSI_INSTALL_ISCSID)
+	$(OPEN_ISCSI_INSTALL_ISCSISTART)
+endef
+
+ifeq ($(BR2_PACKAGE_OPEN_ISCSI_ISCSID),y)
+define OPEN_ISCSI_INSTALL_ISCSID
+	$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/sbin
+	$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin \
+		$(@D)/build/{iscsi-iname,iscsiadm,iscsid}
+	$(INSTALL) -D -m 644 {$(@D)/etc,$(TARGET_DIR)/etc/iscsi}/iscsid.conf
+endef
+
+define OPEN_ISCSI_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/lib/systemd/system
+	$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/systemd/system \
+		$(@D)/build/{iscsi,iscsi-init,iscsid}.service \
+		$(@D)/etc/systemd/iscsid.socket
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_OPEN_ISCSI_ISCSISTART),y)
+define OPEN_ISCSI_INSTALL_ISCSISTART
+	$(INSTALL) -D -m 755 {$(@D)/build,$(TARGET_DIR)/usr/sbin}/iscsistart
+endef
+endif
+
+define OPEN_ISCSI_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_SCSI_LOWLEVEL)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_ISCSI_TCP)
+endef
+
+$(eval $(meson-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-08 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-26 15:43 [Buildroot] [PATCH 1/1] package/open-iscsi: new package TIAN Yuanhao
2022-09-26 16:27 ` Thomas Petazzoni via buildroot
2022-10-09 11:14 ` [Buildroot] [PATCH v2 " TIAN Yuanhao
2023-02-08 15:39   ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.