From patchwork Mon Jul 4 22:30:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 644426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rk1ts73kPz9t0T for ; Tue, 5 Jul 2016 08:30:45 +1000 (AEST) 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=QT91cvuY; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2D50789D70; Mon, 4 Jul 2016 22:30:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wfaa-aLBI1cK; Mon, 4 Jul 2016 22:30:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 52D5889A8C; Mon, 4 Jul 2016 22:30:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8B3511C1F50 for ; Mon, 4 Jul 2016 22:30:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 86A2786965 for ; Mon, 4 Jul 2016 22:30:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wRfLuL8qiuN0 for ; Mon, 4 Jul 2016 22:30:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BE3708695A for ; Mon, 4 Jul 2016 22:30:41 +0000 (UTC) Received: by mail-pf0-f182.google.com with SMTP id h14so64062647pfe.1 for ; Mon, 04 Jul 2016 15:30:41 -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; bh=JpLLLV2UoUtBhpzzQO0GobL5aGaJq9GlMg1waVUpSQM=; b=QT91cvuYGr+a3FOY7FwCvuxkqOlLO7gFKSILyxBiTaeL+ElbDrpnu34y5YC5Q+EyPL XbrQSvyMLOAVNzPmQa2qNQ5mmLaGXdXA4Q5prbMNWVXfVl7YlRx71gYA2/qIGcXCXfn7 5Q499gFo/jpa2E9999KUxVO0BC7HdTyTjc8czNy4EIdhR3yurAwif+d8ychZwykBj96l DjBhpQAq+UKT+eZWMjGNBrQyFUVfusbxHU2M3Xe61YvRNsF0KN94IODWY2TCiWTEiHvZ K9QYDhl2ornnCIS6GBg6sDb8unm6NKXU0mpMN5kIhmGbySqJUkXxPMeL8BNNX6iYVRxN JtjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JpLLLV2UoUtBhpzzQO0GobL5aGaJq9GlMg1waVUpSQM=; b=dyI9SPCgacJG6bC3Crr4voinjMLZrwDnUo+8TzjBxpBIkCMNVGhZalN7b+Cx+jSJWr DRfBRZ1GyjY9tjzwn/sGr6oyGex1CaboeB0a2Z6W5N4ma+o7UizMFVZVGUDlo45M+lqA 2xWQVN7MVeEKvKgNqG9ibjVUA4PQd1eBFT2aDrOUBpZ0IbXZEdY0fXlAdJf2UmvvNLpd UJ0LWB/yK0WmioSCnJQa8pB++Hi5y4Q99anY5ijZwteZEr0RwqYoNk83QIAdy5Z7qVu8 S840UuFyx7As9J1XSLS1yejESHOrNjjXTF+vnDtW+uYKJcUbcE9EmofZrUywQUZJB8OZ qWSw== X-Gm-Message-State: ALyK8tJRGX9WEbP6OIINkMZ+qJqFP1Q9C98HayT4xuklHyKGPsNxeEXtw2kta732mWSI0Q== X-Received: by 10.98.92.65 with SMTP id q62mr26608065pfb.26.1467671441421; Mon, 04 Jul 2016 15:30:41 -0700 (PDT) Received: from localhost.localdomain (cpe-108-185-112-114.socal.res.rr.com. [108.185.112.114]) by smtp.gmail.com with ESMTPSA id x67sm7239849pff.47.2016.07.04.15.30.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Jul 2016 15:30:40 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Mon, 4 Jul 2016 15:30:31 -0700 Message-Id: <1467671433-18113-1-git-send-email-christian@paral.in> X-Mailer: git-send-email 2.7.3 Cc: geoff@infradead.org, thomas.petazzoni@free-electrons.com, romain.naour@gmail.com, Christian Stewart Subject: [Buildroot] [PATCH v7 1/3] runc: 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" runC is a CLI tool for spawning and running containers according to the OCP specification. runC is used by the latest Docker engine versions, however, runc itself is standalone and has no other dependencies. https://runc.io/ Signed-off-by: Christian Stewart Reviewed-by: Romain Naour --- Changes since v1: - use call github to generate source url Changes since v3: - fix indentation in Config.in - add dep on threads in Config.in - break gopath into separate variable - use HOST_GO_TARGET_ENV Changes since v4: - use RUNC_VERSION instead of commit hash - only show comment when build is possible with threads enabled Changes since v5: - bump to v1.0.0-rc1 --- --- package/Config.in | 1 + package/runc/Config.in | 13 +++++++++++++ package/runc/runc.hash | 2 ++ package/runc/runc.mk | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 package/runc/Config.in create mode 100644 package/runc/runc.hash create mode 100644 package/runc/runc.mk diff --git a/package/Config.in b/package/Config.in index 2c4c196..078436e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1665,6 +1665,7 @@ menu "System tools" source "package/pwgen/Config.in" source "package/quota/Config.in" source "package/rsyslog/Config.in" + source "package/runc/Config.in" source "package/scrub/Config.in" source "package/scrypt/Config.in" source "package/smack/Config.in" diff --git a/package/runc/Config.in b/package/runc/Config.in new file mode 100644 index 0000000..1802e59 --- /dev/null +++ b/package/runc/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_RUNC + bool "runc" + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_HAS_THREADS + help + runC is a CLI tool for spawning and running containers + according to the OCP specification. + + https://github.com/opencontainers/runc + +comment "runc needs a toolchain w/ threads" + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/runc/runc.hash b/package/runc/runc.hash new file mode 100644 index 0000000..e6ec483 --- /dev/null +++ b/package/runc/runc.hash @@ -0,0 +1,2 @@ +# Locally computed +sha256 77f9d4df1657fecc939be0261fcccccd34d5b22c02b8a49abad23fac33b4059a runc-v1.0.0-rc1.tar.gz diff --git a/package/runc/runc.mk b/package/runc/runc.mk new file mode 100644 index 0000000..3f352bd --- /dev/null +++ b/package/runc/runc.mk @@ -0,0 +1,46 @@ +################################################################################ +# +# runc +# +################################################################################ + +RUNC_VERSION = v1.0.0-rc1 +RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION)) + +RUNC_LICENSE = Apache-2.0 +RUNC_LICENSE_FILES = LICENSE + +RUNC_DEPENDENCIES = host-go + +RUNC_GOPATH = "$(@D)/Godeps/_workspace" +RUNC_MAKE_ENV = $(HOST_GO_TARGET_ENV) \ + CGO_ENABLED=1 \ + GOBIN="$(@D)/bin" \ + GOPATH="$(RUNC_GOPATH)" + +RUNC_GLDFLAGS = \ + -X main.gitCommit=$(RUNC_VERSION) \ + -extldflags '-static' + +RUNC_GOTAGS = cgo static_build + +ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) +RUNC_GOTAGS += seccomp +RUNC_DEPENDENCIES += libseccomp +endif + +define RUNC_CONFIGURE_CMDS + mkdir -p $(RUNC_GOPATH)/src/github.com/opencontainers + ln -s $(@D) $(RUNC_GOPATH)/src/github.com/opencontainers/runc +endef + +define RUNC_BUILD_CMDS + cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/usr/bin/go \ + build -v -o $(@D)/bin/runc -tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" . +endef + +define RUNC_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/bin/runc $(TARGET_DIR)/usr/bin/runc +endef + +$(eval $(generic-package))