* [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
* Re: [Buildroot] [PATCH 1/1] package/open-iscsi: new package
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
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-09-26 16:27 UTC (permalink / raw)
To: TIAN Yuanhao; +Cc: buildroot
Hello,
On Mon, 26 Sep 2022 08:43:20 -0700
TIAN Yuanhao <tianyuanhao3@163.com> wrote:
> Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Thanks for this new patch! See comments below.
> +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
Weird option "no_systemd". Why didn't they make that positive logic?
> +
> +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
Isn't a bit annoying to have this kind of mess. Could you instead add
an option in meson.build to enable/disable isns support, and contribute
this improvement upstream?
> +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
Why isn't that installed automatically by the meson build system when
systemd support is enabled?
> +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
It's also a bit annoying that you have to reimplement all the
installation logic. What about improving the meson.build with
additional options, and contribute these improvements upstream?
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 1/1] package/open-iscsi: new package
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 ` TIAN Yuanhao
2023-02-08 15:39 ` Thomas Petazzoni via buildroot
1 sibling, 1 reply; 4+ messages in thread
From: TIAN Yuanhao @ 2022-10-09 11:14 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>
---
Changes in v2:
- Remove installation logic (suggested by Thomas)
While I think a lot of unnecessary stuff is installed, we still have a
working iSCSI agent.
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/open-iscsi/Config.in | 19 +++++++++++++++++++
package/open-iscsi/open-iscsi.hash | 3 +++
package/open-iscsi/open-iscsi.mk | 27 +++++++++++++++++++++++++++
5 files changed, 51 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..04ec120e9a
--- /dev/null
+++ b/package/open-iscsi/Config.in
@@ -0,0 +1,19 @@
+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_ISNS
+ 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
+
+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..9fd651cae8
--- /dev/null
+++ b/package/open-iscsi/open-iscsi.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 9565bdf6b68b223e1e0d455d9a04d7536724a3f5b5a254e9398d06b2a0c6b6d2 open-iscsi-2.1.8.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..4bbd96f591
--- /dev/null
+++ b/package/open-iscsi/open-iscsi.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# open-iscsi
+#
+################################################################################
+
+OPEN_ISCSI_VERSION = 2.1.8
+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 open-isns 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
+
+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
* Re: [Buildroot] [PATCH v2 1/1] package/open-iscsi: new package
2022-10-09 11:14 ` [Buildroot] [PATCH v2 " TIAN Yuanhao
@ 2023-02-08 15:39 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-08 15:39 UTC (permalink / raw)
To: TIAN Yuanhao; +Cc: buildroot
Hello,
On Sun, 9 Oct 2022 04:14:23 -0700
TIAN Yuanhao <tianyuanhao3@163.com> wrote:
> Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
I have applied the patch, with some changes. See below.
> diff --git a/package/open-iscsi/Config.in b/package/open-iscsi/Config.in
> new file mode 100644
> index 0000000000..04ec120e9a
> --- /dev/null
> +++ b/package/open-iscsi/Config.in
> @@ -0,0 +1,19 @@
> +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_ISNS
> + select BR2_PACKAGE_KMOD
> + select BR2_PACKAGE_UTIL_LINUX
> + select BR2_PACKAGE_UTIL_LINUX_LIBS
This BR2_PACKAGE_UTIL_LINUX_LIBS symbol is only for packages that
cannot use util-linux because they would otherwise create a circular
dependency. This is not the case of open-iscsi, so we can use
util-linux directly.
> + select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> + help
> + iSCSI tools for Linux.
> +
> + https://www.open-iscsi.com
> +
> +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..9fd651cae8
> --- /dev/null
> +++ b/package/open-iscsi/open-iscsi.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256 9565bdf6b68b223e1e0d455d9a04d7536724a3f5b5a254e9398d06b2a0c6b6d2 open-iscsi-2.1.8.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..4bbd96f591
> --- /dev/null
> +++ b/package/open-iscsi/open-iscsi.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# open-iscsi
> +#
> +################################################################################
> +
> +OPEN_ISCSI_VERSION = 2.1.8
> +OPEN_ISCSI_SITE = $(call github,open-iscsi,open-iscsi,$(OPEN_ISCSI_VERSION))
> +OPEN_ISCSI_LICENSE = GPL-2.0+
Actually, there is some GPLv3+ code, see
https://github.com/open-iscsi/open-iscsi/issues/379, so I changed this
to GPL-2.0+, GPL-3.0+ and added a comment to explain what's going on.
> +OPEN_ISCSI_LICENSE_FILES = COPYING
> +OPEN_ISCSI_DEPENDENCIES = kmod open-isns openssl util-linux-libs
Changed util-linux-libs to util-linux.
And applied!
Thanks a lot for your contribution!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [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.