diff mbox series

[01/12] dumb-init: new package

Message ID 20171019002257.27646-1-christian@paral.in
State Superseded
Headers show
Series [01/12] dumb-init: new package | expand

Commit Message

Christian Stewart Oct. 19, 2017, 12:22 a.m. UTC
dumb-init is a minimal init process to act as PID 1 for containers.

dumb-init can be used to satisfy docker-engine's docker-init binary
requirement.

In many cases docker-init backing processes like dumb-init must be static, as
they are executed inside a container in an unknown environment. This
patch includes an option to specifically compile dumb-init statically, even if
the system is compiled dynamically.

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/Config.in                |  1 +
 package/dumb-init/Config.in      | 16 ++++++++++++++++
 package/dumb-init/dumb-init.hash |  2 ++
 package/dumb-init/dumb-init.mk   | 28 ++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+)
 create mode 100644 package/dumb-init/Config.in
 create mode 100644 package/dumb-init/dumb-init.hash
 create mode 100644 package/dumb-init/dumb-init.mk

Comments

Arnout Vandecappelle Oct. 19, 2017, 2:04 p.m. UTC | #1
Hi Christian,

 This is already v3 of the series. Could you explain the changes w.r.t. to the
previous versions? You should do that in the commit message...

On 19-10-17 02:22, Christian Stewart wrote:
> dumb-init is a minimal init process to act as PID 1 for containers.
> 
> dumb-init can be used to satisfy docker-engine's docker-init binary
> requirement.
> 
> In many cases docker-init backing processes like dumb-init must be static, as
> they are executed inside a container in an unknown environment. This
> patch includes an option to specifically compile dumb-init statically, even if
> the system is compiled dynamically.
> 
> Signed-off-by: Christian Stewart <christian@paral.in>

 ... here, separated with a --- line:

---
v3:
 - Use foo instead of bar
 - Update commit message to explain baz better [Thomas]

 The [Thomas] means that this change was based on review feedback from Thomas.

 For entirely new patches, you just write:

v3: New patch

 Also, you should send the series with "v3" in the subject. With modern git, you
can do that with the -v3 parameter to git send-email or git format-patch.

 Of course, no need to resend the series for this, but please do explain in a
mail what the changes are. Makes reviewing a lot simpler.


 Regards,
 Arnout

[snip]
Christian Stewart Oct. 19, 2017, 4:10 p.m. UTC | #2
Hi Arnout,

On Thu, Oct 19, 2017 at 10:04 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>  This is already v3 of the series. Could you explain the changes w.r.t. to the
> previous versions? You should do that in the commit message...

Yes, typically I would follow the usual workflow but as this patch
series has for some reason taken many months to merge I neglected it
this time. This series is more of a, "oh hey, that's still pending, I
should go submit it" rather than another distinct revision. I'll be
sure to follow the guidelines in the future.

The changes here incorporated the minor requested changes from the last series:

 - standardize to the github notation for SITE
 - update to the latest version of tini

Overall very minor which is why I waited a bit to re-spin, there don't
seem to be many requested changes to this series and I've tested it
for a few months now.

Best,
Christian
Arnout Vandecappelle Oct. 21, 2017, 1:50 p.m. UTC | #3
Hi Christian,

 We were about to apply but then we thought:

On 19-10-17 02:22, Christian Stewart wrote:
> +config BR2_PACKAGE_DUMB_INIT_STATIC
> +	bool "build static"
> +	help
> +	  Enables static compilation for dumb-init.

 Is it really useful to have this as an option? In practice you'll always want
to link statically, no?

 If you're OK with this I can remove the option while applying, no need to
respin just for this.

 Regards,
 Arnout
Christian Stewart Oct. 24, 2017, 3:07 a.m. UTC | #4
Hi Arnout,

On Sat, Oct 21, 2017 at 9:50 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>  If you're OK with this I can remove the option while applying, no need to
> respin just for this.

Go for it, same goes for tini.

Best,
Christian
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index a27f55aec1..c161634daf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1862,6 +1862,7 @@  comment "Utilities"
 	source "package/crudini/Config.in"
 	source "package/dialog/Config.in"
 	source "package/dtach/Config.in"
+	source "package/dumb-init/Config.in"
 	source "package/file/Config.in"
 	source "package/easy-rsa/Config.in"
 	source "package/gnupg/Config.in"
diff --git a/package/dumb-init/Config.in b/package/dumb-init/Config.in
new file mode 100644
index 0000000000..56ca6dc7b1
--- /dev/null
+++ b/package/dumb-init/Config.in
@@ -0,0 +1,16 @@ 
+config BR2_PACKAGE_DUMB_INIT
+	bool "dumb-init"
+	help
+	  dumb-init is a simple but valid init binary to act as PID 1 for
+	  containers.
+
+	  https://github.com/Yelp/dumb-init
+
+if BR2_PACKAGE_DUMB_INIT
+
+config BR2_PACKAGE_DUMB_INIT_STATIC
+	bool "build static"
+	help
+	  Enables static compilation for dumb-init.
+
+endif
diff --git a/package/dumb-init/dumb-init.hash b/package/dumb-init/dumb-init.hash
new file mode 100644
index 0000000000..e7987b36e2
--- /dev/null
+++ b/package/dumb-init/dumb-init.hash
@@ -0,0 +1,2 @@ 
+# Locally computed
+sha256	74486997321bd939cad2ee6af030f481d39751bc9aa0ece84ed55f864e309a3f	dumb-init-v1.2.0.tar.gz
diff --git a/package/dumb-init/dumb-init.mk b/package/dumb-init/dumb-init.mk
new file mode 100644
index 0000000000..f2855122fb
--- /dev/null
+++ b/package/dumb-init/dumb-init.mk
@@ -0,0 +1,28 @@ 
+################################################################################
+#
+# dumb-init
+#
+################################################################################
+
+DUMB_INIT_VERSION = v1.2.0
+DUMB_INIT_SITE = $(call github,Yelp,dumb-init,$(DUMB_INIT_VERSION))
+
+DUMB_INIT_LICENSE = MIT
+DUMB_INIT_LICENSE_FILES = LICENSE
+DUMB_INIT_CFLAGS=$(TARGET_CFLAGS) $(TARGET_LDFLAGS)
+
+ifeq ($(BR2_PACKAGE_DUMB_INIT_STATIC),y)
+DUMB_INIT_CFLAGS += -static
+endif
+
+define DUMB_INIT_BUILD_CMDS
+	$(TARGET_CC) \
+		$(DUMB_INIT_CFLAGS) \
+		-o $(@D)/dumb-init $(@D)/dumb-init.c
+endef
+
+define DUMB_INIT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/dumb-init $(TARGET_DIR)/usr/bin/dumb-init
+endef
+
+$(eval $(generic-package))