diff mbox series

[v2,1/3] package/tinyinit: new package

Message ID 20240820191927.2126281-2-dario.binacchi@amarulasolutions.com
State Changes Requested, archived
Headers show
Series tinyinit and stm32f746_disco_sd_defconfig | expand

Commit Message

Dario Binacchi Aug. 20, 2024, 7:19 p.m. UTC
This package contains a Linux init script suitable for resource-limited
systems which can be used as an alternative to the one provided by
Busybox.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes v1 -> v2:
 - Rename tinit to tinyinit.
 - Put the script inside the tinyinit package without the need to use
   a github repo.
 - Update the commit message.

 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/tinyinit/Config.in   |  7 +++++++
 package/tinyinit/tinyinit.mk | 12 ++++++++++++
 system/Config.in             |  5 +++++
 5 files changed, 26 insertions(+)
 create mode 100644 package/tinyinit/Config.in
 create mode 100644 package/tinyinit/tinyinit.mk

Comments

Yann E. MORIN Aug. 20, 2024, 7:58 p.m. UTC | #1
Dario, all,

On 2024-08-20 21:19 +0200, Dario Binacchi spake thusly:
> This package contains a Linux init script suitable for resource-limited
> systems which can be used as an alternative to the one provided by
> Busybox.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
> Changes v1 -> v2:
>  - Rename tinit to tinyinit.
>  - Put the script inside the tinyinit package without the need to use
>    a github repo.

Did you actually forgot to git-add that file?

[--SNIP--]
> diff --git a/system/Config.in b/system/Config.in
> index 318c538ef1d0..9e15a785f3f0 100644
> --- a/system/Config.in
> +++ b/system/Config.in
> @@ -145,6 +145,11 @@ comment "systemd highly recommends Linux >= 4.15"
>  	depends on BR2_INIT_SYSTEMD
>  	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
>  
> +config BR2_INIT_TINYINIT
> +	bool "tiny init"
> +	select BR2_PACKAGE_TINYINIT
> +	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT

I'm not sure it warrants an entry in that init selection. I think
corner-cases like tiny-init should be treated as "no init system" and
the "None" entry below be used instead (in fact, I would even argue it
should be labelled "Custom" rather than "None", because that's what it
refers to: using a custom init system).

We already have tini as a tiny initsystem (mostly aimed at
container-based worloads), which is not in the list, and I believe
tiniy-init should also be consdered similarly...

Furthermore, we need to have an entry in that list of init system when
we need to have infrastructure for it: install init scripts for
sysv-like, systemd units for systemd, openrc "units" for openrc. For
tiny-init (as for tini), there is absolutely no need for any infra at
all, so they are already properly served by selecting the "None" entry
(and selecting the proper package).

Regards,
Yann E. MORIN.

>  config BR2_INIT_NONE
>  	bool "None"
>  	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Dario Binacchi Aug. 22, 2024, 6:34 p.m. UTC | #2
Hello Yann,

On Tue, Aug 20, 2024 at 9:58 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Dario, all,
>
> On 2024-08-20 21:19 +0200, Dario Binacchi spake thusly:
> > This package contains a Linux init script suitable for resource-limited
> > systems which can be used as an alternative to the one provided by
> > Busybox.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> > Changes v1 -> v2:
> >  - Rename tinit to tinyinit.
> >  - Put the script inside the tinyinit package without the need to use
> >    a github repo.
>
> Did you actually forgot to git-add that file?

Yes, you're right, I totally forgot about it.
I'm sorry.

>
> [--SNIP--]
> > diff --git a/system/Config.in b/system/Config.in
> > index 318c538ef1d0..9e15a785f3f0 100644
> > --- a/system/Config.in
> > +++ b/system/Config.in
> > @@ -145,6 +145,11 @@ comment "systemd highly recommends Linux >= 4.15"
> >       depends on BR2_INIT_SYSTEMD
> >       depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
> >
> > +config BR2_INIT_TINYINIT
> > +     bool "tiny init"
> > +     select BR2_PACKAGE_TINYINIT
> > +     select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
>
> I'm not sure it warrants an entry in that init selection. I think
> corner-cases like tiny-init should be treated as "no init system" and
> the "None" entry below be used instead (in fact, I would even argue it
> should be labelled "Custom" rather than "None", because that's what it
> refers to: using a custom init system).
>
> We already have tini as a tiny initsystem (mostly aimed at
> container-based worloads), which is not in the list, and I believe
> tiniy-init should also be consdered similarly...
>
> Furthermore, we need to have an entry in that list of init system when
> we need to have infrastructure for it: install init scripts for
> sysv-like, systemd units for systemd, openrc "units" for openrc. For
> tiny-init (as for tini), there is absolutely no need for any infra at
> all, so they are already properly served by selecting the "None" entry
> (and selecting the proper package).

Ok, thank you for your explanations.

Thanks and regards,
Dario

>
> Regards,
> Yann E. MORIN.
>
> >  config BR2_INIT_NONE
> >       bool "None"
> >       select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
> > --
> > 2.43.0
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index d7d0af35431b..45cc1cc48996 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -791,6 +791,7 @@  F:	configs/imx8mn_bsh_smm_s2_defconfig
 F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
 F:	configs/stm32f769_disco_sd_defconfig
 F:	package/sscep/
+F:	package/tinyinit/
 F:	package/uuu/
 
 N:	Dario Binacchi <dariobin@libero.it>
diff --git a/package/Config.in b/package/Config.in
index f2c63ffb6ec6..435134fd38c5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2870,6 +2870,7 @@  menu "System tools"
 	source "package/tar/Config.in"
 	source "package/tealdeer/Config.in"
 	source "package/thermald/Config.in"
+	source "package/tinyinit/Config.in"
 	source "package/tpm-tools/Config.in"
 	source "package/tpm2-abrmd/Config.in"
 	source "package/tpm2-tools/Config.in"
diff --git a/package/tinyinit/Config.in b/package/tinyinit/Config.in
new file mode 100644
index 000000000000..c780ed3cac3a
--- /dev/null
+++ b/package/tinyinit/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_TINYINIT
+	bool "tinyinit"
+	depends on BR2_INIT_TINYINIT
+	help
+	  A Linux tiny initialization script suitable for resource
+	  limited systems, which can be used as an alternative to the
+	  one provided by Busybox.
diff --git a/package/tinyinit/tinyinit.mk b/package/tinyinit/tinyinit.mk
new file mode 100644
index 000000000000..c7bb144dee68
--- /dev/null
+++ b/package/tinyinit/tinyinit.mk
@@ -0,0 +1,12 @@ 
+################################################################################
+#
+# tinyinit
+#
+################################################################################
+
+define TINYINIT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(TINYINIT_PKGDIR)/init $(TARGET_DIR)/sbin/init
+	(cd $(TARGET_DIR); ln -sf /sbin/init init)
+endef
+
+$(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index 318c538ef1d0..9e15a785f3f0 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -145,6 +145,11 @@  comment "systemd highly recommends Linux >= 4.15"
 	depends on BR2_INIT_SYSTEMD
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
 
+config BR2_INIT_TINYINIT
+	bool "tiny init"
+	select BR2_PACKAGE_TINYINIT
+	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT
+
 config BR2_INIT_NONE
 	bool "None"
 	select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT