From patchwork Thu Oct 19 00:22:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 827883 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.136; helo=silver.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="t7IKibiz"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yHVDW3kBmz9t6x for ; Thu, 19 Oct 2017 11:29:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BC28F3023C; Thu, 19 Oct 2017 00:29:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8YKDoapN4kmS; Thu, 19 Oct 2017 00:29:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F3854301A3; Thu, 19 Oct 2017 00:29:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 98E6E1CE75C for ; Thu, 19 Oct 2017 00:29:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 94715301A3 for ; Thu, 19 Oct 2017 00:29:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vS0TexROJd92 for ; Thu, 19 Oct 2017 00:29:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io0-f193.google.com (mail-io0-f193.google.com [209.85.223.193]) by silver.osuosl.org (Postfix) with ESMTPS id 0F17930180 for ; Thu, 19 Oct 2017 00:29:22 +0000 (UTC) Received: by mail-io0-f193.google.com with SMTP id m16so8179119iod.1 for ; Wed, 18 Oct 2017 17:29:22 -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=xOUlJws+MORazqDs/NXkBcMzbGqRHAnTszelC1JElUs=; b=t7IKibizSPxUa5zPai1OGOfmqcDPQBJtKU9dnARMGwZELTbUNRaspgD54dxaq1MkQB yFMLoGAwfZzHCk8KxX3OsiKWHldZrMub66NsGC5VjI9ZVvHNE+57Ak6wV60jWFZ4PV7O cLNR8x+sfB2tu7kZZj6gd0Km8nXDulc06fLrb05oaVXV104vgjJNhS3dDXKlra/bv4KC adED0R1KpiXYpCvsv7WO93yC+JsCyk89JBsGfp3/mbesn22nT7YTNT7JC3mVDM6bFUpn IgesiM2w7Rl40O2JsqbHo9YUW6B86RlkJyM+1pLDnjlZy/fC1XWYoZbIxJec4FNnxPiI VvHA== 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=xOUlJws+MORazqDs/NXkBcMzbGqRHAnTszelC1JElUs=; b=aSPICPwnIIEr01H5f7daM8SZilfSWxhB/I7elOgjwf+G0Yb/ySJW8QF3IYtHEi4BwR pyZmNQ24exunIJkAipgVarKuOKiGoTZwegHFRNrwnvDSWk1HQCsPZiz9mCCQBNoscbB3 JvySScW9Uf9ORf1RVJITvTmxVnnSuK3JQ8MsneYUVtZ2TtikuyZcg3UNSCZOj8dnL30I cOkLlJOBpUeg31f+5b4pI9lLJEv9y7f5CVA2fwXaCBYYzHxpPZWsvYAXYtUyIOo60hgQ MtZ5RQr6OAiqRWHp1IoIWmGCg6vHYHkFifQ6AaddZYdbbtArNtlYDX/bv3PGfE0kcTSa E1/w== X-Gm-Message-State: AMCzsaVxqhjFg+64O15LIXAegG5S/fikOaGARRqtVuvjb91p29vY+KFn EkMn1K8xQhCjIEtrPU9CVE9W2nXX X-Google-Smtp-Source: ABhQp+RoY/p1pF3A2wNsgsWXSCPw+jZumeDwKdUIzx5sh9IcKgxzNCJk9tINUZnHDLg53G5voj/vxg== X-Received: by 10.107.130.193 with SMTP id m62mr339401ioi.273.1508372585732; Wed, 18 Oct 2017 17:23:05 -0700 (PDT) Received: from localhost.localdomain (69-174-167-231.lfytina2.metronetinc.net. [69.174.167.231]) by smtp.gmail.com with ESMTPSA id w136sm89624ita.36.2017.10.18.17.23.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Oct 2017 17:23:04 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Wed, 18 Oct 2017 20:22:47 -0400 Message-Id: <20171019002257.27646-2-christian@paral.in> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171019002257.27646-1-christian@paral.in> References: <20171019002257.27646-1-christian@paral.in> Cc: Christian Stewart , fontaine.fabrice@gmail.com Subject: [Buildroot] [PATCH 02/12] 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 | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 66 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 c161634daf..f8f9f39167 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1878,6 +1878,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..f8c8c2a3aa --- /dev/null +++ b/package/tini/tini.hash @@ -0,0 +1,2 @@ +# Locally computed +sha256 c2b7fe2fb92e71911d06b7571b53d4e7e8985b34efe2a599670b070b000c8dbe tini-v0.16.1.tar.gz diff --git a/package/tini/tini.mk b/package/tini/tini.mk new file mode 100644 index 0000000000..a43f3f0162 --- /dev/null +++ b/package/tini/tini.mk @@ -0,0 +1,42 @@ +################################################################################ +# +# tini +# +################################################################################ + +TINI_VERSION = v0.16.1 +TINI_SITE = $(call github,krallin,tini,$(TINI_VERSION)) + +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))