From patchwork Fri Sep 18 08:19:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markos Chandras X-Patchwork-Id: 519170 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 B1666140273 for ; Fri, 18 Sep 2015 18:19:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F003A9569A; Fri, 18 Sep 2015 08:19:45 +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 hIzhoAinmVZU; Fri, 18 Sep 2015 08:19:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 543C595694; Fri, 18 Sep 2015 08:19:45 +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 48D071C2128 for ; Fri, 18 Sep 2015 08:19:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4067033DD5 for ; Fri, 18 Sep 2015 08:19:44 +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 FCYxD42jHBPd for ; Fri, 18 Sep 2015 08:19:43 +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 silver.osuosl.org (Postfix) with ESMTP id D246133AC7 for ; Fri, 18 Sep 2015 08:19:42 +0000 (UTC) Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id D04E862E27C29 for ; Fri, 18 Sep 2015 09:19:35 +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; Fri, 18 Sep 2015 09:19:37 +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; Fri, 18 Sep 2015 09:19:36 +0100 From: Markos Chandras To: Date: Fri, 18 Sep 2015 09:19:31 +0100 Message-ID: <1442564371-10498-1-git-send-email-markos.chandras@imgtec.com> X-Mailer: git-send-email 2.5.2 In-Reply-To: <55FAF226.9080800@imgtec.com> References: <55FAF226.9080800@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.154.88] Cc: Markos Chandras Subject: [Buildroot] [PATCH v2] 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: Tested-by: Vicente Olivert Riera --- 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..5ebd8c54ac1f 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/libseccomp/{tests,tools} && \ + for x in tests tools; do \ + find $(@D)/$$x -maxdepth 1 \( -name "*.tests" -o -perm -a=x \) \ + -type f -exec cp {} $(TARGET_DIR)/usr/libseccomp/$$x/ \; ; \ + done +endef + +LIBSECCOMP_POST_INSTALL_TARGET_HOOKS += LIBSECCOMP_TESTS_INSTALL + +endif + $(eval $(autotools-package))