From: Christian Stewart <christian@paral.in>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/9] tini: new package
Date: Wed, 20 Sep 2017 04:02:03 +0100 [thread overview]
Message-ID: <20170920030210.19446-3-christian@paral.in> (raw)
In-Reply-To: <20170920030210.19446-1-christian@paral.in>
Tini is a minimal init process to act as PID 1 for containers.
Tini can be used to satisfy docker-engine's docker-init binary
requirement.
In many cases docker-init backing processes like Tini must be static, as
they are executed inside a container in an unknown environment. This
patch adds an option to specifically compile Tini statically, even if
the system is compiled dynamically.
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/Config.in | 1 +
package/tini/Config.in | 21 +++++++++++++++++++++
package/tini/tini.hash | 2 ++
package/tini/tini.mk | 41 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 65 insertions(+)
create mode 100644 package/tini/Config.in
create mode 100644 package/tini/tini.hash
create mode 100644 package/tini/tini.mk
diff --git a/package/Config.in b/package/Config.in
index 96f04dec7a..b3fb8fa222 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1851,6 +1851,7 @@ comment "Utilities"
source "package/sudo/Config.in"
source "package/terminology/Config.in"
source "package/time/Config.in"
+ source "package/tini/Config.in"
source "package/tmux/Config.in"
source "package/which/Config.in"
source "package/xmlstarlet/Config.in"
diff --git a/package/tini/Config.in b/package/tini/Config.in
new file mode 100644
index 0000000000..323b9d17a1
--- /dev/null
+++ b/package/tini/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_TINI
+ bool "tini"
+ help
+ tini is a simple but valid init binary to
+ act as PID 1 for containers.
+
+ https://github.com/krallin/tini
+
+if BR2_PACKAGE_TINI
+
+config BR2_PACKAGE_TINI_MINIMAL
+ bool "build minimal variant"
+ help
+ Disables argument parsing and verbose output.
+
+config BR2_PACKAGE_TINI_STATIC
+ bool "build static"
+ help
+ Enables static compilation for tini.
+
+endif
diff --git a/package/tini/tini.hash b/package/tini/tini.hash
new file mode 100644
index 0000000000..a4731bb791
--- /dev/null
+++ b/package/tini/tini.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 d624bb6fba3bc02701977813b7bdac9dfc9bdeedf88aff67066cf8948d2ec6ab v0.14.0.tar.gz
diff --git a/package/tini/tini.mk b/package/tini/tini.mk
new file mode 100644
index 0000000000..6fa40e7920
--- /dev/null
+++ b/package/tini/tini.mk
@@ -0,0 +1,41 @@
+################################################################################
+#
+# tini
+#
+################################################################################
+
+TINI_VERSION = v0.14.0
+TINI_SITE = https://github.com/krallin/tini/archive
+TINI_SOURCE = $(TINI_VERSION).tar.gz
+TINI_LICENSE = MIT
+TINI_LICENSE_FILES = LICENSE
+TINI_CFLAGS = $(TARGET_CFLAGS) -DTINI_VERSION=\"$(TINI_VERSION)\" -DTINI_GIT=\"\"
+
+ifeq ($(BR2_PACKAGE_TINI_MINIMAL),y)
+TINI_CFLAGS += -DTINI_MINIMAL
+endif
+
+ifeq ($(BR2_PACKAGE_TINI_STATIC),y)
+TINI_CFLAGS += -static
+endif
+
+ifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
+TINI_CFLAGS += -fstack-protector --param=ssp-buffer-size=4
+endif
+
+define TINI_CONFIGURE_CMDS
+ printf "#pragma once\n" > $(@D)/src/tiniConfig.h
+endef
+
+define TINI_BUILD_CMDS
+ $(TARGET_CC) \
+ $(TINI_CFLAGS) \
+ -o $(@D)/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
--
2.13.5
next prev parent reply other threads:[~2017-09-20 3:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 3:02 [Buildroot] [PATCH 0/9] Upgrading Go to 1.9 and Docker to v2017.07 Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 1/9] dumb-init: new package Christian Stewart
2017-09-21 21:23 ` Arnout Vandecappelle
2017-09-21 23:13 ` Christian Stewart
2017-09-20 3:02 ` Christian Stewart [this message]
2017-09-20 4:40 ` [Buildroot] [PATCH 2/9] tini: " Baruch Siach
2017-09-20 10:32 ` Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 3/9] docker-engine: add support for init processes Christian Stewart
2017-09-21 21:37 ` Arnout Vandecappelle
2017-09-21 23:09 ` Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 4/9] docker-engine: select static for tini and dumb-init Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 5/9] docker-proxy: new package Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 6/9] docker-engine: add dependency on docker-proxy Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 7/9] runc: bump to v1.0.0-rc4 Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 8/9] docker-containerd: bump to 3addd84 Christian Stewart
2017-09-20 3:02 ` [Buildroot] [PATCH 9/9] docker-engine: bump to v17.07.0-ce Christian Stewart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170920030210.19446-3-christian@paral.in \
--to=christian@paral.in \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.