diff mbox series

[1/3] package/tinit: new package

Message ID 20240803155517.3499273-2-dario.binacchi@amarulasolutions.com
State Changes Requested
Headers show
Series tinit and stm32f746_disco_sd_defconfig | expand

Commit Message

Dario Binacchi Aug. 3, 2024, 3:55 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>
---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/tinit/Config.in  |  9 +++++++++
 package/tinit/tinit.hash |  3 +++
 package/tinit/tinit.mk   | 17 +++++++++++++++++
 system/Config.in         |  5 +++++
 6 files changed, 36 insertions(+)
 create mode 100644 package/tinit/Config.in
 create mode 100644 package/tinit/tinit.hash
 create mode 100644 package/tinit/tinit.mk
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 68729f721b6f..5fef1fd3da2f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -797,6 +797,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/tinit/
 F:	package/uuu/
 
 N:	Dario Binacchi <dariobin@libero.it>
diff --git a/package/Config.in b/package/Config.in
index e21987717f16..818d96e3b1b5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2866,6 +2866,7 @@  menu "System tools"
 	source "package/tar/Config.in"
 	source "package/tealdeer/Config.in"
 	source "package/thermald/Config.in"
+	source "package/tinit/Config.in"
 	source "package/tpm-tools/Config.in"
 	source "package/tpm2-abrmd/Config.in"
 	source "package/tpm2-tools/Config.in"
diff --git a/package/tinit/Config.in b/package/tinit/Config.in
new file mode 100644
index 000000000000..e711b37e89f0
--- /dev/null
+++ b/package/tinit/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_TINIT
+	bool "tinit"
+	depends on BR2_INIT_TINIT
+	help
+	  A Linux tiny initialization script suitable for resource
+	  limited systems, which can be used as an alternative to the
+	  one provided by Busybox.
+
+	  https://github.com/passgat/tinit
diff --git a/package/tinit/tinit.hash b/package/tinit/tinit.hash
new file mode 100644
index 000000000000..e8c6d1386277
--- /dev/null
+++ b/package/tinit/tinit.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  27cc4dbbd88df00dd98b64cbadf3d1de6062d8a4ea7bc405c445e560c6dd23c1  tinit-0.1.0.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  LICENSE
diff --git a/package/tinit/tinit.mk b/package/tinit/tinit.mk
new file mode 100644
index 000000000000..5fa9ad8d2329
--- /dev/null
+++ b/package/tinit/tinit.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# tinit
+#
+################################################################################
+
+TINIT_VERSION = 0.1.0
+TINIT_SITE = $(call github,passgat,tinit,v$(TINIT_VERSION))
+TINIT_LICENSE = GPL-2.0
+TINIT_LICENSE_FILES = LICENSE
+
+define TINIT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/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 bc0c6eb6bc82..a4543b104769 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_TINIT
+	bool "tiny init"
+	select BR2_PACKAGE_TINIT
+	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