Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC 0/3] init: Add s6 as init system
@ 2019-01-16 21:51 Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host Vadim Kochan
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Vadim Kochan @ 2019-01-16 21:51 UTC (permalink / raw)
  To: buildroot

Add new system init support (BR2_INIT_S6) based on s6 suite. This is very-very
basic support which does not have any setup automation logic (but only getty)
but it allows to install custom s6-rc services in a bit easier way by the
board. All s6-rc services which were copied by rootfs-overlay or post-build
will be compiled as s6-rc db into /etc/s6-rc/compiled-initial, which also has
/etc/s6-rc/compiled link to easy replace it in runtime.

In case if such kind of change will be merged, then may be it would be good to
think about of some packages integration into s6-rc system.

Vadim Kochan (3):
  package/s6-linux-init: Build also for the host
  package/s6-linux-init: Allow to install as init system
  package/s6-rc: Allow to integrate s6-rc services

 package/s6-linux-init/s6-linux-init.mk | 69 +++++++++++++++++++++++++++++++++-
 package/s6-rc/rc.init                  |  4 ++
 package/s6-rc/rc.shutdown              |  3 ++
 package/s6-rc/s6-rc.mk                 | 32 ++++++++++++++++
 system/Config.in                       |  9 ++++-
 5 files changed, 114 insertions(+), 3 deletions(-)
 create mode 100644 package/s6-rc/rc.init
 create mode 100644 package/s6-rc/rc.shutdown

-- 
2.14.1

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

* [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host
  2019-01-16 21:51 [Buildroot] [RFC 0/3] init: Add s6 as init system Vadim Kochan
@ 2019-01-16 21:51 ` Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 2/3] package/s6-linux-init: Allow to install as init system Vadim Kochan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Vadim Kochan @ 2019-01-16 21:51 UTC (permalink / raw)
  To: buildroot

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(-)

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))
-- 
2.14.1

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

* [Buildroot] [RFC 2/3] package/s6-linux-init: Allow to install as init system
  2019-01-16 21:51 [Buildroot] [RFC 0/3] init: Add s6 as init system Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host Vadim Kochan
@ 2019-01-16 21:51 ` Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 3/3] package/s6-rc: Allow to integrate s6-rc services Vadim Kochan
  2019-01-20 15:31 ` [Buildroot] [RFC 0/3] init: Add s6 as init system Eric Le Bihan
  3 siblings, 0 replies; 8+ messages in thread
From: Vadim Kochan @ 2019-01-16 21:51 UTC (permalink / raw)
  To: buildroot

Add BR2_INIT_S6 option which allows to install minimal init support
by s6-linux-init-maker into /etc/s6 and link /sbin/init to it.

Also 2 additional files /etc/rc.init and /etc/rc.shutdown are generated as
dummy "execline'd" scripts which are triggered by /etc/s6/init.

Consider generic tty option support and generate getty service if
needed by s6-linux-init-maker.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 package/s6-linux-init/s6-linux-init.mk | 40 ++++++++++++++++++++++++++++++++++
 system/Config.in                       |  9 ++++++--
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/package/s6-linux-init/s6-linux-init.mk b/package/s6-linux-init/s6-linux-init.mk
index 913f837c1f..c298d62477 100644
--- a/package/s6-linux-init/s6-linux-init.mk
+++ b/package/s6-linux-init/s6-linux-init.mk
@@ -33,6 +33,46 @@ define S6_LINUX_INIT_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
 endef
 
+ifeq ($(BR2_INIT_S6),y)
+
+# Don't let Busybox to install it's own tools like poweroff, reboot, halt, etc
+S6_LINUX_INIT_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+
+S6_LINUX_INIT_MAKER_OPTS = -b /usr/bin -c /etc/s6
+
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
+S6_LINUX_INIT_MAKER_OPTS += -d 0
+else
+S6_LINUX_INIT_MAKER_OPTS += $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS),,-d 1)
+endif
+
+ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
+S6_LINUX_INIT_MAKER_OPTS += -G "/sbin/getty -L \
+			  $(SYSTEM_GETTY_OPTIONS) \
+			  $(SYSTEM_GETTY_PORT) \
+			  $(SYSTEM_GETTY_BAUDRATE) \
+			  $(SYSTEM_GETTY_TERM)"
+endif
+
+define S6_LINUX_INIT_INSTALL_INIT
+	ln -sf ../etc/s6/init $(TARGET_DIR)/sbin/init
+
+	ln -sf /usr/bin/s6-reboot $(TARGET_DIR)/sbin/reboot
+	ln -sf /usr/bin/s6-poweroff $(TARGET_DIR)/sbin/poweroff
+	ln -sf /usr/bin/s6-halt $(TARGET_DIR)/sbin/halt
+
+	echo "#! /usr/bin/execlineb -P" > $(@D)/rc.init
+	$(INSTALL) -m 0755 $(@D)/rc.init $(TARGET_DIR)/etc/rc.init
+	echo "#! /usr/bin/execlineb -P" > $(@D)/rc.shutdown
+	$(INSTALL) -m 0755 $(@D)/rc.shutdown $(TARGET_DIR)/etc/rc.shutdown
+
+	rm -rf $(TARGET_DIR)/etc/s6
+	$(HOST_DIR)/bin/s6-linux-init-maker $(S6_LINUX_INIT_MAKER_OPTS) $(TARGET_DIR)/etc/s6
+endef
+S6_LINUX_INIT_POST_INSTALL_TARGET_HOOKS += S6_LINUX_INIT_INSTALL_INIT
+
+endif # BR2_INIT_S6
+
 HOST_S6_LINUX_INIT_DEPENDENCIES = host-s6
 
 HOST_S6_LINUX_INIT_CONF_OPTS = \
diff --git a/system/Config.in b/system/Config.in
index 9941807e5d..5bab283931 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -12,6 +12,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT
 	select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_INIT_SYSV
 	select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_INIT_BUSYBOX
 	select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_INIT_SYSTEMD
+	select BR2_PACKAGE_SKELETON_INIT_COMMON if BR2_INIT_S6
 	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_INIT_NONE
 	help
 	  Use default target skeleton
@@ -124,6 +125,10 @@ comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10"
 		!BR2_TOOLCHAIN_HAS_SSP || \
 		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
 
+config BR2_INIT_S6
+	bool "s6"
+	select BR2_PACKAGE_S6_LINUX_INIT
+
 config BR2_INIT_NONE
 	bool "None"
 	help
@@ -342,7 +347,7 @@ config BR2_TARGET_GENERIC_GETTY_TERM
 	string "TERM environment variable"
 	default "vt100"
 	# currently observed only by busybox and sysvinit
-	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV
+	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV || BR2_INIT_S6
 	help
 	  Specify a TERM type.
 
@@ -350,7 +355,7 @@ config BR2_TARGET_GENERIC_GETTY_OPTIONS
 	string "other options to pass to getty"
 	default ""
 	# currently observed only by busybox and sysvinit
-	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV
+	depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV || BR2_INIT_S6
 	help
 	  Any other flags you want to pass to getty,
 	  Refer to getty --help for details.
-- 
2.14.1

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

* [Buildroot] [RFC 3/3] package/s6-rc: Allow to integrate s6-rc services
  2019-01-16 21:51 [Buildroot] [RFC 0/3] init: Add s6 as init system Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host Vadim Kochan
  2019-01-16 21:51 ` [Buildroot] [RFC 2/3] package/s6-linux-init: Allow to install as init system Vadim Kochan
@ 2019-01-16 21:51 ` Vadim Kochan
  2019-01-20 15:31 ` [Buildroot] [RFC 0/3] init: Add s6 as init system Eric Le Bihan
  3 siblings, 0 replies; 8+ messages in thread
From: Vadim Kochan @ 2019-01-16 21:51 UTC (permalink / raw)
  To: buildroot

It allows to install s6-rc services by board or package into
/etc/s6-rc/service which will be compiled as s6-rc db as
/etc/s6-rc/compiled-initial. Services are compiled on stage
when rootfs overlay & post-build already performed.

Added rc.init & rc.shutdown scripts which are needed to run s6-rc
services.

This is very basic s6-rc system support which even does not have the
basic stuff like /proc /sys /dev setup, but this might be added in
future work.

All above is only possible if BR2_INIT_S6 is selected.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 package/s6-rc/rc.init     |  4 ++++
 package/s6-rc/rc.shutdown |  3 +++
 package/s6-rc/s6-rc.mk    | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 package/s6-rc/rc.init
 create mode 100644 package/s6-rc/rc.shutdown

diff --git a/package/s6-rc/rc.init b/package/s6-rc/rc.init
new file mode 100644
index 0000000000..6709c6488b
--- /dev/null
+++ b/package/s6-rc/rc.init
@@ -0,0 +1,4 @@
+#! /usr/bin/execlineb -P
+
+if { s6-rc-init /run/service }
+if { s6-rc -t 600000 -- change default }
diff --git a/package/s6-rc/rc.shutdown b/package/s6-rc/rc.shutdown
new file mode 100644
index 0000000000..58d49b5cfd
--- /dev/null
+++ b/package/s6-rc/rc.shutdown
@@ -0,0 +1,3 @@
+#! /usr/bin/execlineb -P
+
+s6-rc -da change
diff --git a/package/s6-rc/s6-rc.mk b/package/s6-rc/s6-rc.mk
index 222ba139c6..007e7d9e1b 100644
--- a/package/s6-rc/s6-rc.mk
+++ b/package/s6-rc/s6-rc.mk
@@ -11,6 +11,13 @@ S6_RC_LICENSE_FILES = COPYING
 S6_RC_INSTALL_STAGING = YES
 S6_RC_DEPENDENCIES = s6
 
+ifeq ($(BR2_INIT_S6),y)
+# Needs s6-rc-compile to create initial rc db, also
+# build after s6-linux-init to rewrite rc.init for run
+# s6-rc services.
+S6_RC_DEPENDENCIES += host-s6-rc s6-linux-init
+endif
+
 S6_RC_CONF_OPTS = \
 	--prefix=/usr \
 	--with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \
@@ -44,6 +51,31 @@ define S6_RC_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
 endef
 
+ifeq ($(BR2_INIT_S6),y)
+
+define S6_RC_PREPARE_INIT_RC
+	mkdir -p $(TARGET_DIR)/etc/s6-rc/service/default
+	echo bundle > $(TARGET_DIR)/etc/s6-rc/service/default/type
+	touch $(TARGET_DIR)/etc/s6-rc/service/default/contents
+
+	mkdir -p $(TARGET_DIR)/etc/s6-rc/compiled-initial
+	ln -sf compiled-initial $(TARGET_DIR)/etc/s6-rc/compiled
+
+	$(INSTALL) -m 0755 $(S6_RC_PKGDIR)/rc.init $(TARGET_DIR)/etc/rc.init
+	$(INSTALL) -m 0755 $(S6_RC_PKGDIR)/rc.shutdown $(TARGET_DIR)/etc/rc.shutdown
+endef
+S6_RC_POST_INSTALL_TARGET_HOOKS += S6_RC_PREPARE_INIT_RC
+
+define S6_RC_FINALIZE_INIT_RC
+	rm -rf $(TARGET_DIR)/etc/s6-rc/compiled-initial
+	$(HOST_DIR)/bin/s6-rc-compile -v 1 \
+		$(TARGET_DIR)/etc/s6-rc/compiled-initial \
+		$(TARGET_DIR)/etc/s6-rc/service
+endef
+S6_RC_ROOTFS_PRE_CMD_HOOKS += S6_RC_FINALIZE_INIT_RC
+
+endif # BR2_INIT_S6
+
 HOST_S6_RC_DEPENDENCIES = host-s6
 
 HOST_S6_RC_CONF_OPTS = \
-- 
2.14.1

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

* [Buildroot] [RFC 0/3] init: Add s6 as init system
  2019-01-16 21:51 [Buildroot] [RFC 0/3] init: Add s6 as init system Vadim Kochan
                   ` (2 preceding siblings ...)
  2019-01-16 21:51 ` [Buildroot] [RFC 3/3] package/s6-rc: Allow to integrate s6-rc services Vadim Kochan
@ 2019-01-20 15:31 ` Eric Le Bihan
  2019-01-30 20:50   ` Thomas De Schampheleire
  2019-02-08 12:20   ` Vadym Kochan
  3 siblings, 2 replies; 8+ messages in thread
From: Eric Le Bihan @ 2019-01-20 15:31 UTC (permalink / raw)
  To: buildroot

Hi!
On 2019-01-16 23:51, Vadim Kochan wrote:
> Add new system init support (BR2_INIT_S6) based on s6 suite. This is very-very
> basic support which does not have any setup automation logic (but only getty)
> but it allows to install custom s6-rc services in a bit easier way by the
> board. All s6-rc services which were copied by rootfs-overlay or post-build
> will be compiled as s6-rc db into /etc/s6-rc/compiled-initial, which also has
> /etc/s6-rc/compiled link to easy replace it in runtime.
>
> In case if such kind of change will be merged, then may be it would be good to
> think about of some packages integration into s6-rc system.
>
> Vadim Kochan (3):
>   package/s6-linux-init: Build also for the host
>   package/s6-linux-init: Allow to install as init system
>   package/s6-rc: Allow to integrate s6-rc services
>
>  package/s6-linux-init/s6-linux-init.mk | 69 +++++++++++++++++++++++++++++++++-
>  package/s6-rc/rc.init                  |  4 ++
>  package/s6-rc/rc.shutdown              |  3 ++
>  package/s6-rc/s6-rc.mk                 | 32 ++++++++++++++++
>  system/Config.in                       |  9 ++++-
>  5 files changed, 114 insertions(+), 3 deletions(-)
>  create mode 100644 package/s6-rc/rc.init
>  create mode 100644 package/s6-rc/rc.shutdown
>
> --
> 2.14.1
>

I worked on a s6-based init system eons ago [1], but without using a
host variant of s6-linux-init.

I'll test your patches.

[1] https://github.com/elebihan/br2-ext-skarnet

Regards,

--
ELB

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

* [Buildroot] [RFC 0/3] init: Add s6 as init system
  2019-01-20 15:31 ` [Buildroot] [RFC 0/3] init: Add s6 as init system Eric Le Bihan
@ 2019-01-30 20:50   ` Thomas De Schampheleire
  2019-02-08 12:20   ` Vadym Kochan
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2019-01-30 20:50 UTC (permalink / raw)
  To: buildroot

Hi Eric, Vadim,

El dom., 20 ene. 2019 a las 16:32, Eric Le Bihan
(<eric.le.bihan.dev@free.fr>) escribi?:
>
> Hi!
> On 2019-01-16 23:51, Vadim Kochan wrote:
> > Add new system init support (BR2_INIT_S6) based on s6 suite. This is very-very
> > basic support which does not have any setup automation logic (but only getty)
> > but it allows to install custom s6-rc services in a bit easier way by the
> > board. All s6-rc services which were copied by rootfs-overlay or post-build
> > will be compiled as s6-rc db into /etc/s6-rc/compiled-initial, which also has
> > /etc/s6-rc/compiled link to easy replace it in runtime.
> >
> > In case if such kind of change will be merged, then may be it would be good to
> > think about of some packages integration into s6-rc system.
> >
> > Vadim Kochan (3):
> >   package/s6-linux-init: Build also for the host
> >   package/s6-linux-init: Allow to install as init system
> >   package/s6-rc: Allow to integrate s6-rc services
> >
> >  package/s6-linux-init/s6-linux-init.mk | 69 +++++++++++++++++++++++++++++++++-
> >  package/s6-rc/rc.init                  |  4 ++
> >  package/s6-rc/rc.shutdown              |  3 ++
> >  package/s6-rc/s6-rc.mk                 | 32 ++++++++++++++++
> >  system/Config.in                       |  9 ++++-
> >  5 files changed, 114 insertions(+), 3 deletions(-)
> >  create mode 100644 package/s6-rc/rc.init
> >  create mode 100644 package/s6-rc/rc.shutdown
> >
> > --
> > 2.14.1
> >
>
> I worked on a s6-based init system eons ago [1], but without using a
> host variant of s6-linux-init.
>
> I'll test your patches.
>
> [1] https://github.com/elebihan/br2-ext-skarnet
>

We are based on Eric's original s6 init files, before it was moved to
a BR2_EXTERNAL logic.
But I'm no s6 expert at all, so I can't really comment on these changes.
Nevertheless, I'm quite interested to see how this evolves so we can
align our local situation with something in upstream Buildroot.

Best regards,
Thomas

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

* [Buildroot] [RFC 0/3] init: Add s6 as init system
  2019-01-20 15:31 ` [Buildroot] [RFC 0/3] init: Add s6 as init system Eric Le Bihan
  2019-01-30 20:50   ` Thomas De Schampheleire
@ 2019-02-08 12:20   ` Vadym Kochan
  2019-02-11 21:40     ` Eric Le Bihan
  1 sibling, 1 reply; 8+ messages in thread
From: Vadym Kochan @ 2019-02-08 12:20 UTC (permalink / raw)
  To: buildroot

Hi Eric,

On Sun, Jan 20, 2019 at 04:31:51PM +0100, Eric Le Bihan wrote:
> Hi!
> On 2019-01-16 23:51, Vadim Kochan wrote:
> > Add new system init support (BR2_INIT_S6) based on s6 suite. This is very-very
> > basic support which does not have any setup automation logic (but only getty)
> > but it allows to install custom s6-rc services in a bit easier way by the
> > board. All s6-rc services which were copied by rootfs-overlay or post-build
> > will be compiled as s6-rc db into /etc/s6-rc/compiled-initial, which also has
> > /etc/s6-rc/compiled link to easy replace it in runtime.
> >
> > In case if such kind of change will be merged, then may be it would be good to
> > think about of some packages integration into s6-rc system.
> >
> > Vadim Kochan (3):
> >   package/s6-linux-init: Build also for the host
> >   package/s6-linux-init: Allow to install as init system
> >   package/s6-rc: Allow to integrate s6-rc services
> >
> >  package/s6-linux-init/s6-linux-init.mk | 69 +++++++++++++++++++++++++++++++++-
> >  package/s6-rc/rc.init                  |  4 ++
> >  package/s6-rc/rc.shutdown              |  3 ++
> >  package/s6-rc/s6-rc.mk                 | 32 ++++++++++++++++
> >  system/Config.in                       |  9 ++++-
> >  5 files changed, 114 insertions(+), 3 deletions(-)
> >  create mode 100644 package/s6-rc/rc.init
> >  create mode 100644 package/s6-rc/rc.shutdown
> >
> > --
> > 2.14.1
> >
> 
> I worked on a s6-based init system eons ago [1], but without using a
> host variant of s6-linux-init.
> 
> I'll test your patches.
> 
> [1] https://github.com/elebihan/br2-ext-skarnet
> 
> Regards,
> 
> --
> ELB

Do you have any conceptual comments regarding this ? Also I think may be
it's better to have /etc/s6-rc into /etc/s6/rc.

Thanks!
Vadim Kochan

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

* [Buildroot] [RFC 0/3] init: Add s6 as init system
  2019-02-08 12:20   ` Vadym Kochan
@ 2019-02-11 21:40     ` Eric Le Bihan
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Le Bihan @ 2019-02-11 21:40 UTC (permalink / raw)
  To: buildroot

On 2019-02-08 14:20, Vadym Kochan wrote:
> Hi Eric,
>
> On Sun, Jan 20, 2019 at 04:31:51PM +0100, Eric Le Bihan wrote:
> > Hi!
> > On 2019-01-16 23:51, Vadim Kochan wrote:
> > > Add new system init support (BR2_INIT_S6) based on s6 suite. This is very-very
> > > basic support which does not have any setup automation logic (but only getty)
> > > but it allows to install custom s6-rc services in a bit easier way by the
> > > board. All s6-rc services which were copied by rootfs-overlay or post-build
> > > will be compiled as s6-rc db into /etc/s6-rc/compiled-initial, which also has
> > > /etc/s6-rc/compiled link to easy replace it in runtime.
> > >
> > > In case if such kind of change will be merged, then may be it would be good to
> > > think about of some packages integration into s6-rc system.
> > >
> > > Vadim Kochan (3):
> > >   package/s6-linux-init: Build also for the host
> > >   package/s6-linux-init: Allow to install as init system
> > >   package/s6-rc: Allow to integrate s6-rc services
> > >
> > >  package/s6-linux-init/s6-linux-init.mk | 69 +++++++++++++++++++++++++++++++++-
> > >  package/s6-rc/rc.init                  |  4 ++
> > >  package/s6-rc/rc.shutdown              |  3 ++
> > >  package/s6-rc/s6-rc.mk                 | 32 ++++++++++++++++
> > >  system/Config.in                       |  9 ++++-
> > >  5 files changed, 114 insertions(+), 3 deletions(-)
> > >  create mode 100644 package/s6-rc/rc.init
> > >  create mode 100644 package/s6-rc/rc.shutdown
> > >
> > > --
> > > 2.14.1
> > >
> >
> > I worked on a s6-based init system eons ago [1], but without using a
> > host variant of s6-linux-init.
> >
> > I'll test your patches.
> >
> > [1] https://github.com/elebihan/br2-ext-skarnet
> >
> > Regards,
> >
> > --
> > ELB
>
> Do you have any conceptual comments regarding this ? Also I think may be
> it's better to have /etc/s6-rc into /etc/s6/rc.

I tested your series and it works fine. As you are using the file system
pre and post command hooks to compile the database services, this is
cleaner than using a post-build script as done in my external
customization.

I had not used s6-linux-init-maker at that time, but favored a
hand-written init. Now this tool does the job, so it is OK to use it.

If this series is applied and a s6-based init option is available to the
user, I think that providing kerneld/syslogd via s6-log may be useful.
The same may apply to network configuration. The selling point of a
s6-based init system is the service supervision and having the basic
services available and supervised contribute to it.

But adding support for s6-compliant services is tricky, as unlike
systemd, services are not available as files but as directories. So
providing some for the basic services in Buildroot may clutter the
source tree. My approach was to provide them via dedicated projects
(s6-br2-init{skeleton,services}), but there may be a cleaner one. The
nosh init system [1] provides a tool to convert systemd services, so may
be such a tool for s6 may do the trick.

As for /etc/s6-rc vs. /etc/s6/rc, the later may indeed be better, as
there is already /etc/s6/init.

[1] https://jdebp.eu/Softwares/nosh/

Regards,

--
ELB

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

end of thread, other threads:[~2019-02-11 21:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 21:51 [Buildroot] [RFC 0/3] init: Add s6 as init system Vadim Kochan
2019-01-16 21:51 ` [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host Vadim Kochan
2019-01-16 21:51 ` [Buildroot] [RFC 2/3] package/s6-linux-init: Allow to install as init system Vadim Kochan
2019-01-16 21:51 ` [Buildroot] [RFC 3/3] package/s6-rc: Allow to integrate s6-rc services Vadim Kochan
2019-01-20 15:31 ` [Buildroot] [RFC 0/3] init: Add s6 as init system Eric Le Bihan
2019-01-30 20:50   ` Thomas De Schampheleire
2019-02-08 12:20   ` Vadym Kochan
2019-02-11 21:40     ` Eric Le Bihan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox