From patchwork Wed Sep 20 03:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 815976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=paral-in.20150623.gappssmtp.com header.i=@paral-in.20150623.gappssmtp.com header.b="avwS2IPA"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxl8f5bNYz9s82 for ; Wed, 20 Sep 2017 13:09:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E9BC188950; Wed, 20 Sep 2017 03:09:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 90rqcGJU1119; Wed, 20 Sep 2017 03:09:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 951A98892B; Wed, 20 Sep 2017 03:09:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0E3471C41D9 for ; Wed, 20 Sep 2017 03:09:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0560C8890C for ; Wed, 20 Sep 2017 03:09:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id udDDGCdvMYEk for ; Wed, 20 Sep 2017 03:09:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1F37D81E49 for ; Wed, 20 Sep 2017 03:09:32 +0000 (UTC) Received: by mail-wr0-f177.google.com with SMTP id l39so1008704wrl.12 for ; Tue, 19 Sep 2017 20:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paral-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QeyfTqad9GbvGoeYTTbotewVNyQaJtqLm0P7yG6OKP4=; b=avwS2IPAvX1/ePCv5Ld6Ek2X4+MiClyGTL41RpaY0DYPFZJawI+CiRKtHTSsSLfeCD Ic5u9PUi3qB9YRMgSFktGmcgwhi08B6Fi3jcYL5M0A0FFwJslfVS8H4Iwkp+uYJ7utS1 0xM03doCCB1X7JZVoLLYmd+O3/jq2tn+vG7eeHRdiXSTex1sa4vtr+hOM1xTYdJxuDJi ZXt2AQsaIAtUnrf0Fw+9EEBKEXnPLiDTSeqIdgvPV+xALrTw3oa3y/dREH2oJXZ5gSrG UAZwYw2XhWfdzM2ewLO05BC87vPU4ck930YRIHzTi/uHcvCaHlCPkDSEekwWmMttf5wr f2tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QeyfTqad9GbvGoeYTTbotewVNyQaJtqLm0P7yG6OKP4=; b=M7sqh2mHWufp0E+yF3ZwLwFLja30iksD42TeI5skkOxamIUk8ZEnCNX3P9ntprtkMx kD3jch7xD11wJH7sQTjsG4tdbsjHnFeqavHH+d2v2qiGXTFng2GhJC93wr1fMHWHak3Q F1/33l84pH74fIEshsDihnHUYPB8OlQqdaCmRWeNsyAjGkeF5ldB8gn/xydbGxTtiupT drfbUU6IXF7LyEiyfPV2n2AY6EadKhApHzo3o4mwZuXduCqTPvWnczHUoFn4Qp2r/TAY Ed0XuxKM7MxPSjvwHYzahDQ2jGC2g30wWXP4e1KQ9bfUZZNHIbu10UBaoTEE+fuzW22K lPpQ== X-Gm-Message-State: AHPjjUiNNPSw3/FDcl73PUSP2e4WKUdvPlrkpVbU+uKDIqBWPip7ORJ4 hzx6vHzqwflKetbQWy7hbwC3QEaS X-Google-Smtp-Source: AOwi7QBpnUIha7Jp+CtfOrl/s3uvHMvoreGwvIP46pplsyp56eNgeJQP9oZ6uB1V5F2Y/jtvlkb0lw== X-Received: by 10.223.193.140 with SMTP id x12mr2992215wre.155.1505876537892; Tue, 19 Sep 2017 20:02:17 -0700 (PDT) Received: from ember.home ([2a00:23c1:5b80:3501:e08a:3b55:75b1:41fb]) by smtp.gmail.com with ESMTPSA id i131sm585601wmf.31.2017.09.19.20.02.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 20:02:17 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Wed, 20 Sep 2017 04:02:03 +0100 Message-Id: <20170920030210.19446-3-christian@paral.in> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170920030210.19446-1-christian@paral.in> References: <20170920030210.19446-1-christian@paral.in> Cc: thomas.petazzoni@free-electrons.com, geoff@infradead.org, Christian Stewart Subject: [Buildroot] [PATCH 2/9] tini: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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))