mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] rsinit: add recipe
@ 2026-10-21  7:25 Fabian Pfitzner
  0 siblings, 0 replies; only message in thread
From: Fabian Pfitzner @ 2026-10-21  7:25 UTC (permalink / raw)
  To: ptxdist; +Cc: Fabian Pfitzner

rsinit is a minimalistic single binary init
for the initramfs for embedded systems

Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
---
 rules/rsinit.cargo.make | 92 +++++++++++++++++++++++++++++++++++++++++
 rules/rsinit.in         | 30 ++++++++++++++
 rules/rsinit.make       | 85 +++++++++++++++++++++++++++++++++++++
 3 files changed, 207 insertions(+)
 create mode 100644 rules/rsinit.cargo.make
 create mode 100644 rules/rsinit.in
 create mode 100644 rules/rsinit.make

diff --git a/rules/rsinit.cargo.make b/rules/rsinit.cargo.make
new file mode 100644
index 000000000..d2559f919
--- /dev/null
+++ b/rules/rsinit.cargo.make
@@ -0,0 +1,92 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2026 by Fabian Pfitzner <f.pfitzner@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# WARNING: This file is generated with 'ptxdist cargosync rsinit' and
+# should not be modified manually!
+#
+
+RSINIT_CARGO_LOCK_MD5 := cf110cc03520a150ba9d3159a976ef43
+
+RSINIT_BITFLAGS_2_13_0_SHA256	:= b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8
+RSINIT_BITFLAGS_2_13_0_URL		:= $(call ptx/mirror, CRATESIO, bitflags/2.13.0/download)
+RSINIT_BITFLAGS_2_13_0_SOURCE	:= $(SRCDIR)/bitflags-2.13.0.crate
+RSINIT_PARTS			+= RSINIT_BITFLAGS_2_13_0
+
+RSINIT_CFG_IF_1_0_4_SHA256	:= 9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801
+RSINIT_CFG_IF_1_0_4_URL		:= $(call ptx/mirror, CRATESIO, cfg-if/1.0.4/download)
+RSINIT_CFG_IF_1_0_4_SOURCE	:= $(SRCDIR)/cfg-if-1.0.4.crate
+RSINIT_PARTS			+= RSINIT_CFG_IF_1_0_4
+
+RSINIT_CFG_ALIASES_0_2_1_SHA256	:= 613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724
+RSINIT_CFG_ALIASES_0_2_1_URL		:= $(call ptx/mirror, CRATESIO, cfg_aliases/0.2.1/download)
+RSINIT_CFG_ALIASES_0_2_1_SOURCE	:= $(SRCDIR)/cfg_aliases-0.2.1.crate
+RSINIT_PARTS			+= RSINIT_CFG_ALIASES_0_2_1
+
+RSINIT_GETRANDOM_0_2_17_SHA256	:= ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0
+RSINIT_GETRANDOM_0_2_17_URL		:= $(call ptx/mirror, CRATESIO, getrandom/0.2.17/download)
+RSINIT_GETRANDOM_0_2_17_SOURCE	:= $(SRCDIR)/getrandom-0.2.17.crate
+RSINIT_PARTS			+= RSINIT_GETRANDOM_0_2_17
+
+RSINIT_GIT_VERSION_0_3_9_SHA256	:= 1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19
+RSINIT_GIT_VERSION_0_3_9_URL		:= $(call ptx/mirror, CRATESIO, git-version/0.3.9/download)
+RSINIT_GIT_VERSION_0_3_9_SOURCE	:= $(SRCDIR)/git-version-0.3.9.crate
+RSINIT_PARTS			+= RSINIT_GIT_VERSION_0_3_9
+
+RSINIT_GIT_VERSION_MACRO_0_3_9_SHA256	:= 53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0
+RSINIT_GIT_VERSION_MACRO_0_3_9_URL		:= $(call ptx/mirror, CRATESIO, git-version-macro/0.3.9/download)
+RSINIT_GIT_VERSION_MACRO_0_3_9_SOURCE	:= $(SRCDIR)/git-version-macro-0.3.9.crate
+RSINIT_PARTS			+= RSINIT_GIT_VERSION_MACRO_0_3_9
+
+RSINIT_JSON_0_12_4_SHA256	:= 078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd
+RSINIT_JSON_0_12_4_URL		:= $(call ptx/mirror, CRATESIO, json/0.12.4/download)
+RSINIT_JSON_0_12_4_SOURCE	:= $(SRCDIR)/json-0.12.4.crate
+RSINIT_PARTS			+= RSINIT_JSON_0_12_4
+
+RSINIT_LIBC_0_2_186_SHA256	:= 68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66
+RSINIT_LIBC_0_2_186_URL		:= $(call ptx/mirror, CRATESIO, libc/0.2.186/download)
+RSINIT_LIBC_0_2_186_SOURCE	:= $(SRCDIR)/libc-0.2.186.crate
+RSINIT_PARTS			+= RSINIT_LIBC_0_2_186
+
+RSINIT_LOG_0_4_32_SHA256	:= 953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a
+RSINIT_LOG_0_4_32_URL		:= $(call ptx/mirror, CRATESIO, log/0.4.32/download)
+RSINIT_LOG_0_4_32_SOURCE	:= $(SRCDIR)/log-0.4.32.crate
+RSINIT_PARTS			+= RSINIT_LOG_0_4_32
+
+RSINIT_NIX_0_31_3_SHA256	:= cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d
+RSINIT_NIX_0_31_3_URL		:= $(call ptx/mirror, CRATESIO, nix/0.31.3/download)
+RSINIT_NIX_0_31_3_SOURCE	:= $(SRCDIR)/nix-0.31.3.crate
+RSINIT_PARTS			+= RSINIT_NIX_0_31_3
+
+RSINIT_PROC_MACRO2_1_0_106_SHA256	:= 8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934
+RSINIT_PROC_MACRO2_1_0_106_URL		:= $(call ptx/mirror, CRATESIO, proc-macro2/1.0.106/download)
+RSINIT_PROC_MACRO2_1_0_106_SOURCE	:= $(SRCDIR)/proc-macro2-1.0.106.crate
+RSINIT_PARTS			+= RSINIT_PROC_MACRO2_1_0_106
+
+RSINIT_QUOTE_1_0_45_SHA256	:= 41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924
+RSINIT_QUOTE_1_0_45_URL		:= $(call ptx/mirror, CRATESIO, quote/1.0.45/download)
+RSINIT_QUOTE_1_0_45_SOURCE	:= $(SRCDIR)/quote-1.0.45.crate
+RSINIT_PARTS			+= RSINIT_QUOTE_1_0_45
+
+RSINIT_SYN_2_0_118_SHA256	:= 1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422
+RSINIT_SYN_2_0_118_URL		:= $(call ptx/mirror, CRATESIO, syn/2.0.118/download)
+RSINIT_SYN_2_0_118_SOURCE	:= $(SRCDIR)/syn-2.0.118.crate
+RSINIT_PARTS			+= RSINIT_SYN_2_0_118
+
+RSINIT_UNICODE_IDENT_1_0_24_SHA256	:= e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75
+RSINIT_UNICODE_IDENT_1_0_24_URL		:= $(call ptx/mirror, CRATESIO, unicode-ident/1.0.24/download)
+RSINIT_UNICODE_IDENT_1_0_24_SOURCE	:= $(SRCDIR)/unicode-ident-1.0.24.crate
+RSINIT_PARTS			+= RSINIT_UNICODE_IDENT_1_0_24
+
+RSINIT_WASI_0_11_1_WASI_SNAPSHOT_PREVIEW1_SHA256	:= ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b
+RSINIT_WASI_0_11_1_WASI_SNAPSHOT_PREVIEW1_URL		:= $(call ptx/mirror, CRATESIO, wasi/0.11.1+wasi-snapshot-preview1/download)
+RSINIT_WASI_0_11_1_WASI_SNAPSHOT_PREVIEW1_SOURCE	:= $(SRCDIR)/wasi-0.11.1+wasi-snapshot-preview1.crate
+RSINIT_PARTS			+= RSINIT_WASI_0_11_1_WASI_SNAPSHOT_PREVIEW1
+
+
+# vim: syntax=make
diff --git a/rules/rsinit.in b/rules/rsinit.in
new file mode 100644
index 000000000..b674b67ac
--- /dev/null
+++ b/rules/rsinit.in
@@ -0,0 +1,30 @@
+## SECTION=initmethod
+
+menuconfig RSINIT
+	tristate
+	prompt "rsinit"
+	help
+	  Minimalistic single binary init for the
+	  initramfs for embedded systems.
+
+if RSINIT
+
+config RSINIT_SYSTEMD
+	bool
+	default y
+	depends on INITMETHOD_SYSTEMD
+	prompt "enable systemd feature"
+
+config RSINIT_DMVERITY
+	bool
+	prompt "enable dmverity feature"
+
+config RSINIT_REBOOT_ON_FAILURE
+	bool
+	prompt "enable reboot-on-failure feature"
+
+config RSINIT_USB9PFS
+	bool
+	prompt "enable usb9pfs feature"
+
+endif
diff --git a/rules/rsinit.make b/rules/rsinit.make
new file mode 100644
index 000000000..11c275b39
--- /dev/null
+++ b/rules/rsinit.make
@@ -0,0 +1,85 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2026 by Fabian Pfitzner <f.pfitzner@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+EXTRA_PACKAGES-$(PTXCONF_RSINIT) += rsinit
+
+#
+# Paths and names
+#
+RSINIT_VERSION	:= v0.1.0
+RSINIT_SHA256	:= 385afc198237bc8c6183516f6b1444d428e130112f0752f40b8364ed6d8c9936
+RSINIT		:= rsinit-$(RSINIT_VERSION)
+RSINIT_SUFFIX	:= tar.gz
+RSINIT_URL		:= https://github.com/pengutronix/rsinit/archive/$(RSINIT_VERSION).$(RSINIT_SUFFIX)
+RSINIT_SOURCE	:= $(SRCDIR)/$(RSINIT).$(RSINIT_SUFFIX)
+RSINIT_DIR		:= $(BUILDDIR)/$(RSINIT)
+RSINIT_LICENSE	:= GPL-2.0-only
+RSINIT_LICENSE_FILES	:= \
+	file://LICENSES/CC0-1.0.txt;md5=65d3616852dbf7b1a6d4b53b00626032 \
+	file://LICENSES/GPL-2.0-only.txt;md5=570a9b3749dd0463a1778803b12a6dce
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+RSINIT_FEATURES-y :=
+RSINIT_FEATURES-$(PTXCONF_RSINIT_SYSTEMD) += systemd
+RSINIT_FEATURES-$(PTXCONF_RSINIT_DMVERITY) += dmverity
+RSINIT_FEATURES-$(PTXCONF_RSINIT_REBOOT_ON_FAILURE) += reboot-on-failure
+RSINIT_FEATURES-$(PTXCONF_RSINIT_USB9PFS) += usb9pfs
+
+RSINIT_FEATURES := $(subst $(space),$(comma), $(strip $(RSINIT_FEATURES-y)))
+
+#
+# cargo
+#
+RSINIT_CONF_TOOL	:= cargo
+RSINIT_MAKE_OPT	:= \
+	$(CROSS_CARGO_OPT) \
+	--no-default-features \
+	--features $(RSINIT_FEATURES)
+
+RSINIT_MAKE_ENV := \
+	$(CROSS_ENV) \
+	$(CROSS_CARGO_ENV) \
+	RUSTFLAGS='-C target-feature=+crt-static -Zfmt-debug=none'
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/rsinit.install:
+	@$(call targetinfo)
+	@$(call world/execute, RSINIT, \
+		install -D -v -m755 -t $(RSINIT_PKGDIR)/initramfs \
+			$(RSINIT_DIR)/target/$(PTXCONF_RUST_TARGET)/release/init)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/rsinit.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, rsinit)
+	@$(call install_fixup, rsinit,PRIORITY,optional)
+	@$(call install_fixup, rsinit,SECTION,base)
+	@$(call install_fixup, rsinit,AUTHOR,"Fabian Pfitzner <f.pfitzner@pengutronix.de>")
+	@$(call install_fixup, rsinit,DESCRIPTION,missing)
+
+	@$(call install_copy, rsinit, 0, 0, 0755, -, /initramfs/init)
+
+	@$(call install_finish, rsinit)
+
+	@$(call touch)
+
+# vim: syntax=make



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-21  7:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  7:25 [ptxdist] [PATCH] rsinit: add recipe Fabian Pfitzner

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