Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: TIAN Yuanhao <tianyuanhao3@163.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/open-iscsi: new package
Date: Mon, 26 Sep 2022 18:27:02 +0200	[thread overview]
Message-ID: <20220926182702.3f4d6df8@windsurf> (raw)
In-Reply-To: <20220926154320.35494-1-tianyuanhao3@163.com>

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

  reply	other threads:[~2022-09-26 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-10-09 11:14 ` [Buildroot] [PATCH v2 " TIAN Yuanhao
2023-02-08 15:39   ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220926182702.3f4d6df8@windsurf \
    --to=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tianyuanhao3@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox