diff mbox series

[1/3] package/s6-linux-init: Build also for the host

Message ID 20190216212835.25503-2-vadim4j@gmail.com
State Changes Requested
Headers show
Series init: Add s6 as init system | expand

Commit Message

Vadym Kochan Feb. 16, 2019, 9:28 p.m. UTC
Add strict dependency for host-s6-linux-init to use s6-linux-init-maker
on the host during the rootfs generation.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 package/s6-linux-init/s6-linux-init.mk | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni March 27, 2019, 4:55 p.m. UTC | #1
Hello Vadim,

I am not familiar with s6, so sorry if I'm asking silly questions in
this review.

On Sat, 16 Feb 2019 23:28:33 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> Add strict dependency for host-s6-linux-init to use s6-linux-init-maker
> on the host during the rootfs generation.

I think the wording is not great here: "strict dependency" does not
mean anything in the typical Buildroot speak. I think you wanted to say
"We add host-s6-linux-init as a dependency of the target s6-linux-init,
so that the latter can use the s6-linux-init-maker program as part of
its build process".

However, I think adding this dependency should belong to PATCH 2/3,
where s6-linux-init is actually changed to use s6-linux-init-maker.
Indeed, as I understand it, it's only starting with PATCH 2/3 that
s6-linux-init will need this program. Is this correct ?

If it is, then PATCH 1/3 should only change s6-linux-init.mk to add the
host variant of s6-linux-init.

Thanks!

Thomas
Vadym Kochan April 2, 2019, 3:48 p.m. UTC | #2
Hi Thomas,

On Wed, Mar 27, 2019 at 05:55:03PM +0100, Thomas Petazzoni wrote:
> Hello Vadim,
> 
> I am not familiar with s6, so sorry if I'm asking silly questions in
> this review.
> 
> On Sat, 16 Feb 2019 23:28:33 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > Add strict dependency for host-s6-linux-init to use s6-linux-init-maker
> > on the host during the rootfs generation.
> 
> I think the wording is not great here: "strict dependency" does not
> mean anything in the typical Buildroot speak. I think you wanted to say
> "We add host-s6-linux-init as a dependency of the target s6-linux-init,
> so that the latter can use the s6-linux-init-maker program as part of
> its build process".
> 
> However, I think adding this dependency should belong to PATCH 2/3,
> where s6-linux-init is actually changed to use s6-linux-init-maker.
> Indeed, as I understand it, it's only starting with PATCH 2/3 that
> s6-linux-init will need this program. Is this correct ?

Yes, will move it to the PATCH 2/3.
> 
> If it is, then PATCH 1/3 should only change s6-linux-init.mk to add the
> host variant of s6-linux-init.

Regards,
Vadim Kochan
diff mbox series

Patch

diff --git a/package/s6-linux-init/s6-linux-init.mk b/package/s6-linux-init/s6-linux-init.mk
index d25504ae5a..913f837c1f 100644
--- a/package/s6-linux-init/s6-linux-init.mk
+++ b/package/s6-linux-init/s6-linux-init.mk
@@ -8,7 +8,7 @@  S6_LINUX_INIT_VERSION = 0.4.0.0
 S6_LINUX_INIT_SITE = http://skarnet.org/software/s6-linux-init
 S6_LINUX_INIT_LICENSE = ISC
 S6_LINUX_INIT_LICENSE_FILES = COPYING
-S6_LINUX_INIT_DEPENDENCIES = s6 s6-linux-utils s6-portable-utils
+S6_LINUX_INIT_DEPENDENCIES = s6 s6-linux-utils s6-portable-utils host-s6-linux-init
 
 S6_LINUX_INIT_CONF_OPTS = \
 	--prefix=/usr \
@@ -33,4 +33,31 @@  define S6_LINUX_INIT_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
 endef
 
+HOST_S6_LINUX_INIT_DEPENDENCIES = host-s6
+
+HOST_S6_LINUX_INIT_CONF_OPTS = \
+	--prefix=$(HOST_DIR) \
+	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+	--with-include=$(HOST_DIR)/usr/include \
+	--with-dynlib=$(HOST_DIR)/usr/lib \
+	--with-lib=$(HOST_DIR)/usr/lib/execline \
+	--with-lib=$(HOST_DIR)/usr/lib/s6 \
+	--with-lib=$(HOST_DIR)/usr/lib/skalibs \
+	--disable-static \
+	--enable-shared \
+	--disable-allstatic
+
+define HOST_S6_LINUX_INIT_CONFIGURE_CMDS
+	(cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_S6_LINUX_INIT_CONF_OPTS))
+endef
+
+define HOST_S6_LINUX_INIT_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define HOST_S6_LINUX_INIT_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))