From patchwork Mon Sep 21 09:28:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markos Chandras X-Patchwork-Id: 520208 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]) by ozlabs.org (Postfix) with ESMTP id 3FA45140180 for ; Mon, 21 Sep 2015 19:28:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6279193F64; Mon, 21 Sep 2015 09:28:49 +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 Bk8Et22a5yIK; Mon, 21 Sep 2015 09:28:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 495AA93979; Mon, 21 Sep 2015 09:28:47 +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 E53111CE58C for ; Mon, 21 Sep 2015 09:28:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E107891AF9 for ; Mon, 21 Sep 2015 09:28:45 +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 B1o7LrWkpiCn for ; Mon, 21 Sep 2015 09:28:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by whitealder.osuosl.org (Postfix) with ESMTP id 423E891AEA for ; Mon, 21 Sep 2015 09:28:45 +0000 (UTC) Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 56070AED5930C for ; Mon, 21 Sep 2015 10:28:41 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 21 Sep 2015 10:28:43 +0100 Received: from mchandras-linux.le.imgtec.org (192.168.154.88) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Mon, 21 Sep 2015 10:28:43 +0100 From: Markos Chandras To: Date: Mon, 21 Sep 2015 10:28:36 +0100 Message-ID: <1442827716-8802-1-git-send-email-markos.chandras@imgtec.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <20150920144637.25230558@free-electrons.com> References: <20150920144637.25230558@free-electrons.com> MIME-Version: 1.0 X-Originating-IP: [192.168.154.88] Cc: Markos Chandras Subject: [Buildroot] [PATCH v3] libseccomp: Add new config option to build and install tests 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add new config option to allow building and installing the libseccomp testsuite on the target. It's useful for testing the kernels' seccomp behavior for the target architecture. Signed-off-by: Markos Chandras Reviewed-by: Vicente Olivert Riera Tested-by: Vicente Olivert Riera --- changes since v2: - Move installation path for tests to /usr/share/libseccomp - Do not install python files. We don't support python + libseccomp at the moment so there is no point in installing these tests yet. changes since v1: - Drop compile hook for tests and use MAKE_OPTS instead --- package/libseccomp/Config.in | 9 +++++++++ package/libseccomp/libseccomp.mk | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/package/libseccomp/Config.in b/package/libseccomp/Config.in index 4c34c5466592..760a6f321142 100644 --- a/package/libseccomp/Config.in +++ b/package/libseccomp/Config.in @@ -15,6 +15,15 @@ config BR2_PACKAGE_LIBSECCOMP https://github.com/seccomp/libseccomp +config BR2_PACKAGE_LIBSECCOMP_TESTS + bool "Install libseccomp tests" + depends on BR2_PACKAGE_BASH && BR2_PACKAGE_LIBSECCOMP + help + Build and install the libseccomp testsuite. + +comment "libseccomp testsuite needs bash as running shell" + depends on !BR2_PACKAGE_BASH && BR2_PACKAGE_LIBSECCOMP + comment "libseccomp needs a toolchain w/ headers >= 3.12" depends on BR2_aarch64 || BR2_mips || BR2_mipsel || BR2_mips64 || \ BR2_mips64el || BR2_i386 || BR2_x86_64 diff --git a/package/libseccomp/libseccomp.mk b/package/libseccomp/libseccomp.mk index a188298006b1..e6e578b85561 100644 --- a/package/libseccomp/libseccomp.mk +++ b/package/libseccomp/libseccomp.mk @@ -17,4 +17,20 @@ define LIBSECCOMP_FIXUP_M4_DIR endef LIBSECCOMP_POST_EXTRACT_HOOKS += LIBSECCOMP_FIXUP_M4_DIR +ifeq ($(BR2_PACKAGE_LIBSECCOMP_TESTS),y) + +LIBSECCOMP_MAKE_OPTS += check-build + +define LIBSECCOMP_TESTS_INSTALL + mkdir -p $(TARGET_DIR)/usr/share/libseccomp/{tests,tools} && \ + for x in tests tools; do \ + find $(@D)/$$x -maxdepth 1 \( -name "*.tests" -o -perm -a=x \) -a ! -name "*.py" \ + -type f -exec cp {} $(TARGET_DIR)/usr/share/libseccomp/$$x/ \; ; \ + done +endef + +LIBSECCOMP_POST_INSTALL_TARGET_HOOKS += LIBSECCOMP_TESTS_INSTALL + +endif + $(eval $(autotools-package))