diff mbox series

[3/3] system: add tini as init system

Message ID 23841300f5a85914d9c0fc19b24df485ba861efa.1725049576.git.yann.morin.1998@free.fr
State Accepted
Headers show
Series system: extend the list of init systems (branch yem/init-choice) | expand

Commit Message

Yann E. MORIN Aug. 30, 2024, 8:26 p.m. UTC
Tini is a special-purpose init system, aimed at containers.

Add it to the choice of init systems.

tini does not require much, so we re-use the default "none" skeleton.

Note that tini is no longer selectable on its own, which it used to be.
This change will require that people using tini be careful when
upgrading, though, but that will be very easily caught, as the
containers would no longer start at all.

We could ad a comment stating why, but no other init system has such a
comment, so adding one for tini alone would be weird, so we don't add
one.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/tini/Config.in |  1 +
 system/Config.in       | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

Comments

Dario Binacchi Sept. 14, 2024, 9:04 a.m. UTC | #1
Hi Yann,

On Fri, Aug 30, 2024 at 10:26 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Tini is a special-purpose init system, aimed at containers.
>
> Add it to the choice of init systems.
>
> tini does not require much, so we re-use the default "none" skeleton.
>
> Note that tini is no longer selectable on its own, which it used to be.
> This change will require that people using tini be careful when
> upgrading, though, but that will be very easily caught, as the
> containers would no longer start at all.
>
> We could ad a comment stating why, but no other init system has such a
> comment, so adding one for tini alone would be weird, so we don't add
> one.
>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/tini/Config.in |  1 +
>  system/Config.in       | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/package/tini/Config.in b/package/tini/Config.in
> index 719e1e1f22..bca8ad8e96 100644
> --- a/package/tini/Config.in
> +++ b/package/tini/Config.in
> @@ -1,6 +1,7 @@
>  config BR2_PACKAGE_TINI
>         bool "tini"
>         depends on BR2_USE_MMU # fork()
> +       depends on BR2_INIT_TINI
>         help
>           tini is a simple but valid init binary to
>           act as PID 1 for containers.
> diff --git a/system/Config.in b/system/Config.in
> index 18cc39ad94..d7d59db47d 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -149,6 +149,22 @@ comment "systemd highly recommends Linux >= 4.15"
>
>  comment "Special purpose (read help)"
>
> +config BR2_INIT_TINI
> +       bool "tini"
> +       depends on BR2_USE_MMU  # tini
> +       select BR2_PACKAGE_TINI
> +       select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
> +       help
> +         Tini - A tiny but valid init for containers
> +
> +         Tini is the simplest init you could think of.
> +
> +         All Tini does is spawn a single child (Tini is meant to be run
> +         in a container), and wait for it to exit all the while reaping
> +         zombies and performing signal forwarding.
> +
> +         https://github.com/krallin/tini
> +
>  config BR2_INIT_NONE
>         bool "Custom (none)"
>         select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
> --
> 2.46.0
>

Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Regards,
Dario
diff mbox series

Patch

diff --git a/package/tini/Config.in b/package/tini/Config.in
index 719e1e1f22..bca8ad8e96 100644
--- a/package/tini/Config.in
+++ b/package/tini/Config.in
@@ -1,6 +1,7 @@ 
 config BR2_PACKAGE_TINI
 	bool "tini"
 	depends on BR2_USE_MMU # fork()
+	depends on BR2_INIT_TINI
 	help
 	  tini is a simple but valid init binary to
 	  act as PID 1 for containers.
diff --git a/system/Config.in b/system/Config.in
index 18cc39ad94..d7d59db47d 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -149,6 +149,22 @@  comment "systemd highly recommends Linux >= 4.15"
 
 comment "Special purpose (read help)"
 
+config BR2_INIT_TINI
+	bool "tini"
+	depends on BR2_USE_MMU  # tini
+	select BR2_PACKAGE_TINI
+	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
+	help
+	  Tini - A tiny but valid init for containers
+
+	  Tini is the simplest init you could think of.
+
+	  All Tini does is spawn a single child (Tini is meant to be run
+	  in a container), and wait for it to exit all the while reaping
+	  zombies and performing signal forwarding.
+
+	  https://github.com/krallin/tini
+
 config BR2_INIT_NONE
 	bool "Custom (none)"
 	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT