From patchwork Sun Nov 1 21:25:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 168 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:e04f:0:0:0:0:0 with SMTP id v15csp3614208oos; Mon, 2 Nov 2020 02:39:32 -0800 (PST) X-Received: by 2002:a05:600c:21d5:: with SMTP id x21mr2918912wmj.133.1604313572614; Mon, 02 Nov 2020 02:39:32 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1604313572; cv=pass; d=google.com; s=arc-20160816; b=Om43lgQYMgRPblNbIQu3MHuLfEQzdv7uchKzgP3mXGJKn3xTgoVjvgR/vLZ0i4RiqG GA3b79jG9/PuB2bm0/UQ+pnBlnBtknwuU6oUk62cdVDjiF/rrU204xqbRIhGwS2YR+7c kT4UjDukvnD0dbJ78EmkfBvoGtRm6Qf4dcJbkaSjVjBrVvku6FLFF0JO/SUcu7j1PzgB FNyrxpzAqgDPsON/GKCnMiPAiXhMGCxjANAZcgKYtMYvc7vgvkZmUMlTEIwW2Nnssi/D /owQ3NMVNAYsGeqM8IvjhvOt1l+TfX3YQWO8PjjW7gcwimHaLpJr18pbOk3OfEwG2OAR w7WQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr:sender:dkim-signature; bh=8GfUkkXHcrWRkc351WHPAQ7ui/mX9pzH+owL8ip5Q7Y=; b=udaZ3TPd46tfRc5awm4LUk+/uCsqBJ+A3OelloaZayhlp2YE4VbkwBG8yXdws3gUd7 VRLiqlMhjBviTcQTk0gXtZM8oA076MhHz9ji64qFH4tt7Cu2YtWfAQdXuBoRZYIEF8fz xDMGo/wkXy1RA0x/bUQ6gXT0jvq7gAATRAxy/oHF+NtN7QM70wBcPFwYzboZJUAhr8wB gP/QHhpOr1K+V5X/G6H5C3H6R+uY9d6GXd7R+Q4G50yR9ue1rOdq451uhxBu5qDmKVPB TV8jGU7MhK7gcQF6ylERobCaFVi6y+5shoIvYmmWyZQHZ9+SJDGg42Rd22zPkKvsw+Sg Mqug== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=sTaVCYsQ; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrby6d776akgqeaupfhsi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBY6D776AKGQEAUPFHSI@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id o13sor5774378wmc.12.2020.11.02.02.39.32 (Google Transport Security); Mon, 02 Nov 2020 02:39:32 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrby6d776akgqeaupfhsi@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=sTaVCYsQ; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrby6d776akgqeaupfhsi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBY6D776AKGQEAUPFHSI@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1604313572; cv=pass; d=google.com; s=arc-20160816; b=IzpEZwScKTp3HlGnxXp4hkU31pMo3Qq5ZWJuuqpeDg88I8vW6XW9rUiquGV5XbIx8r UpMdOVxAGqf1xIQZNQnMcxkUwt7D0ZqlVzul+ZYNHhhhOs/WDZsYC67iLu2i57atsU4o KR2W0RmscxrIQ1E3e7RHcbLmpa3otldToDrMCSkCl6+haVIQWUOya45CnC4caAXZNJ52 KZVx5Xez/ospMpWnyw3vS9TGjq95Mv6l4FKd9V5e8T1YNZdtuK/7cYGolIJEwQNvyj69 s7Duuh9jr0ZFnbRIy9Lp2iJwEnqfhjqJ58UnfKlsfNfFQeN/S4bppF3riX+lFnBFSO4U 4+Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr:sender:dkim-signature; bh=8GfUkkXHcrWRkc351WHPAQ7ui/mX9pzH+owL8ip5Q7Y=; b=AcXTub33XjhOAGV/OOItQ6MtTjbn8Q7xlUIilIBizM2pdvSSLDaCSKxD4uYKHikSLd vhU5EYZfzWmIsL9NzOLBhbWq7dVJaasyPiHuohVv4XCC8NAfmrBPNJiPocHfUeMyCl4Q 6YX73CI/zf58zjGDsNcZRu6Wn9fwXrO7Wxk5qzB6ub3mNgc/Hmr+bNyPYsg8EaAfFxjx u9mehHivTIJ/RMA/3X6dMS1+x902b47X1fsto5kj4pffzyrbhJ2pC3cPJ4HdQ/rKDWO4 rb6jpGYSVS/iWf94yQEmuhMYsiLbdMUj87LHahnVpYtGQf3xL2Xrb6g4V4cBB1+DO5j4 2Krw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8GfUkkXHcrWRkc351WHPAQ7ui/mX9pzH+owL8ip5Q7Y=; b=sTaVCYsQzz+1icO5+Pv+qgQRy1QB/zEYmBJnRqjY+g02ohpZALDmFWBhFxACxtB3In FuwrWRvgVdhBL4YQPZjBG2897uXX1Ll6Vanwp6GpZfJYpFvICrUekMNB4Dd7EZtiODM4 CkCNI+h1iFYAJWfnuAFiPLlTdg1zGiK7Sbv5m+AIuCjylxOEqyOZ7MIksS2IP5oANHIZ YRPYSSnywNYqWnMiT0kr/HYqUtvA918CLzuwi26LVo7yjzw1kI/3L1bZ0ExgXcNthd66 AOc6/9BMLw3fXt1u9qYBiy3Q5VGbplVi6cZ1CpcL9VCeERjzSBVp6Vs+EDgKrDjDekZz fmKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:cc :subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8GfUkkXHcrWRkc351WHPAQ7ui/mX9pzH+owL8ip5Q7Y=; b=Z9tlbO7J2EYxkUKqhDkHm6EgsA6sWkaW5iFvo7RMjblgdH1vgcoehLZTbpb0+HVook scHWIUVUmYzMq5YvodtlTzevtmZ8iKGa4OUxlGgm6Mu/JzRuZRUJXu2DR1oQwGOAeYDH fgyCbLLtZDD9Ciq2ffWl6lkuG3uPJf4SOx2KpQ7zMsq3u9+cvbmtK3tNk4fhZYBGCAiy gp4SCLHqQsrJ1BvZ7VHaILpluEg0IUr4oMqbvINuchX3XJEwXanoClja3+7Z+Ocl36Op n3OfMPvMcykJH12WC8Kb8Z6nWA/EgaaL7+hv4fyXfjzksdnUZYhSALv5qjpWjASTBYrs KLJA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM5306GjVGQWgWIigT6tRL7fO8rMbEBNnUKH8AtPNvYM45xHl7Ywn+ /VLHTR2MMZpoPijNWc6exsk= X-Google-Smtp-Source: ABdhPJyvRDX7jWTvZWLtT4QHgIRpnk11+iv0Y7165ErOzD2C4VSqAm1u7GcFf1RlvFGXxoKKV+Xqnw== X-Received: by 2002:a1c:b402:: with SMTP id d2mr17780989wmf.128.1604313571851; Mon, 02 Nov 2020 02:39:31 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:cd8c:: with SMTP id q12ls7480192wrj.0.gmail; Mon, 02 Nov 2020 02:39:30 -0800 (PST) X-Received: by 2002:a5d:5048:: with SMTP id h8mr19533406wrt.135.1604313570792; Mon, 02 Nov 2020 02:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604313570; cv=none; d=google.com; s=arc-20160816; b=FithYsSyNdx/FAle0CESjDW2v5UysHZ3YLo9JytRp7xVwC6FfjUQzThMd2irujhb2u szcQULq5dIVrWoN7hSr8RlOFXtFm3YRkaREEsWIHGKgjYsODfXI09tVQ6feqljtLYmiE wXvMof+dPiwkoAugPctBrUELJv4ng/Ek6gn5dzDI8Z+M3qEr2Um7N7TfmPqmW9ToQZPB WtX+OvZBo+9VDmbpKUVmDwzuHHyDRctVcvdUzvD0RySXpeiq2jqPm2aml/ezHPCRuM/j dZTrsv30u3vPglAjK8IIEw3TRJCYyG5JtqMWHmAxRHSXuAzevlRSlUNo9wXA4/IKdz80 5qgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=Sb9KMOqKTqjN48PiBesRAeVdzTA9G/nk57dARB0M224=; b=SLJrz3MUfbJZMsHF02lVUnsAj7muOZq/3mk5l+LKPLOs/MpmtMC36recGMyOeiy7C5 y6nwAQ0CMSBNs5lzTDbjG6gkfNQB0Jvd/BMSdab+ID9JHFSstwEGL3K2SrtDjux19n2T 1AUz8SRfPJb5yTUUQTYmsQZu3l4EEvjgurwtf0Jk3M3t6BmIQ7nJxw3TKQV6MdKUjTRU KxWrDp3C6mNnvBZxAoRxYAdgcCqHeghCEJQ0lz92yCwTf0vQa8EiOl2s1Ju4+wI43rFL y4kylS9YlB6ke1yafW4PTdNjqLTgG1/9HkcLrayzo5gk1sLnpcXWH6wO1914ZPNW2RHT tDvw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id y14si526839wrq.0.2020.11.02.02.39.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Nov 2020 02:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; IronPort-SDR: EYab5tk2wdXLmfExI+ux+agrmIb5A2Fg/sY4r7w1hp0wRZkAmGm2x/O3tQ+KysdgAttIfIybxK vKobU9nDP6ykPyeIbfPkw+Kf1aLIrbhaywnZ7Og+wG4a3D6iL4R+U0dLgBygIaAmqWUpoWyloA qx3MwIlOBbLnjCi36QGHf7s8e73bG6w/iNSSZAkYOpe6u+gZ13S3UHsR948OEDr915crlTE55H 911gI5h/+INTc+wvdCS2wIq3uuoH8+Vo9M36+YAXbQOHjFEkrHwR31fgWEj71TWv4BzhHiuXk+ t2g= X-IronPort-AV: E=Sophos;i="5.77,444,1596528000"; d="scan'208";a="54577014" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 02 Nov 2020 02:39:28 -0800 IronPort-SDR: K+uXzl1QwIYNaHL+h3W+ZjMfYu0uaSKPKQS5qmbvk0rZmfp4vno4aKu7be85q3UBA9hEy9vc82 yctbPn1HcIrunDdXE5tDbxmQH+/n/U8zcpZRdI+8kW3rxaxWdBAdZvKXYZltAKpqg/BaGl0XMN Awq600PFi7QmBsRlt3q+wyRqK3uE7vBi2jPsi1X6G4d0eqCSZysSxwG+D2MuZhTtJEYjXIo2mz av9/4sC0XQ77i/8fFJTw7uFEqDVH8HJrN6KJK1calYlYPQmVOTYlMF1YYyz1HXRVBSzF7D6x4t 2as= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v4] Add recipe for linux kselftest Date: Mon, 2 Nov 2020 12:55:11 +0530 Message-ID: <20201102072511.26675-1-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1682244708546446728?= X-GMAIL-MSGID: =?utf-8?q?1682244708546446728?= Kselftest is a set of unit and regression tests under the tools/testing/selftests/ directory of the Linux kernel. These are used for testing individual code paths in the kernel. Kselftest is not debianized and is not available as part of the official Debian repository. This patch provides a recipe to build kselftest from the linux source of your choice. Sometimes developers/testers tend to use the latest version of selftests from Linux upstream stable releases for testing and hence the need for a separate recipe instead of being part of the linux recipe of ISAR. Some kselftest test cases build are known to break in certain linux versions, this has to be addressed upstream. Right now kselftest build succeeds even if atleast one of the testcase case build succeeds. You can change that by setting KSELFTEST_FORCE_TARGETS=1. TARGETS, TARGETS_SKIP, FORCE_TARGETS can be set using the appropriate KSELFTEST_* recipe variable. Signed-off-by: Vijai Kumar K --- Changes since v3: - Remove libnuma-dev. Since it is not available in stretch. - remove entry in isar-image-debug. Added to CI image using IMAGE_INSTALL. Changes since v2: - Use deb_debianize instead of individual calls for changelog, compat & control. - Add package to isar-image-debug Changes since v1: - Addressed review comments in v1 - Used debianize APIs for control, compat and changelog. - Moved Depends & S definitions to include file. - Added cross compilation bits in rules. - Change clang, llvm to clang:native & llvm:native .../kselftest/kselftest_5.6.13.bb | 11 ++++ meta/recipes-kernel/kselftest/files/rules | 41 +++++++++++++ meta/recipes-kernel/kselftest/kselftest.inc | 58 +++++++++++++++++++ scripts/ci_build.sh | 1 + 4 files changed, 111 insertions(+) create mode 100644 meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb create mode 100755 meta/recipes-kernel/kselftest/files/rules create mode 100644 meta/recipes-kernel/kselftest/kselftest.inc diff --git a/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb b/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb new file mode 100644 index 0000000..0c9818a --- /dev/null +++ b/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb @@ -0,0 +1,11 @@ +# Kselftest package +# +# This software is a part of ISAR. +# Copyright (c) Mentor Graphics, a Siemens business, 2020 +# +# SPDX-License-Identifier: MIT + +require recipes-kernel/kselftest/kselftest.inc + +SRC_URI += "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz" +SRC_URI[sha256sum] = "f125d79c8f6974213638787adcad6b575bbd35a05851802fd83f622ec18ff987" diff --git a/meta/recipes-kernel/kselftest/files/rules b/meta/recipes-kernel/kselftest/files/rules new file mode 100755 index 0000000..776d341 --- /dev/null +++ b/meta/recipes-kernel/kselftest/files/rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f + +# Debian rules for Kselftest build +# +# This software is a part of ISAR. +# Copyright (c) Mentor, A Siemens Business +# +# SPDX-License-Identifier: MIT + +deb_top_dir:=$(CURDIR)/debian +kselftest_install_dir :=$(deb_top_dir)/kselftest/usr/libexec/kselftest +export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- + +ifeq ($(DEB_HOST_GNU_CPU), arm) +export ARCH=arm +endif +ifeq ($(DEB_HOST_GNU_CPU), aarch64) +export ARCH=arm64 +endif +ifeq ($(DEB_HOST_GNU_CPU), riscv64) +export ARCH=riscv +endif +ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU))) +export ARCH=x86 +endif + +PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2))) + +override_dh_auto_build: + $(MAKE) defconfig + $(MAKE) $(PARALLEL_BUILD) -C tools/testing/selftests/ ${KSELFTEST_ARGS} + +override_dh_auto_install: + mkdir -p ${kselftest_install_dir} + cd tools/testing/selftests/ && KSFT_INSTALL_PATH=${kselftest_install_dir} $(MAKE) $(PARALLEL_BUILD) install ${KSELFTEST_ARGS} + +override_dh_auto_clean: + rm -rf ${deb_top_dir}/kselftest/ + +%: + CFLAGS= LDFLAGS= dh $@ --parallel diff --git a/meta/recipes-kernel/kselftest/kselftest.inc b/meta/recipes-kernel/kselftest/kselftest.inc new file mode 100644 index 0000000..2a76028 --- /dev/null +++ b/meta/recipes-kernel/kselftest/kselftest.inc @@ -0,0 +1,58 @@ +# Kselftest package for Linux +# +# This software is a part of ISAR. +# Copyright (c) Mentor Graphics, a Siemens Business, 2020 +# +# SPDX-License-Identifier: MIT + +inherit dpkg + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# Some test-cases like memfd compilation failed in cross-compilation. +# Force native compilation for now to have consistent output across +# ISAR native/cross compilation setups. +ISAR_CROSS_COMPILE = "0" + +DESCRIPTION ?= "Kernel selftests from Linux kernel ${PV}" + +DEBIAN_BUILD_DEPENDS ?= " \ + rsync, \ + flex, \ + bison, \ + fuse, \ + libelf-dev:native, \ + libcap-ng-dev:native, \ + libpopt-dev:native, \ + libcap-dev:native, \ + libmount-dev:native, \ + libfuse-dev:native, \ + libmnl-dev:native, \ + pkg-config, \ + clang:native, \ + llvm:native, \ +" + +SRC_URI += "file://rules" +S = "${WORKDIR}/linux-${PV}" + +KSELFTEST_TARGETS ?= "" +KSELFTEST_SKIP_TARGETS ?= "" +KSELFTEST_FORCE_TARGETS ?= "0" + +do_prepare_build[cleandirs] += "${S}/debian" +do_prepare_build() { + deb_debianize +} + +dpkg_runbuild_prepend() { + if [ -n "${KSELFTEST_TARGETS}" ];then + export KSELFTEST_ARGS="TARGETS=\"${KSELFTEST_TARGETS}\"" + fi + if [ ${KSELFTEST_FORCE_TARGETS} -eq 1 ];then + export KSELFTEST_ARGS="${KSELFTEST_ARGS} FORCE_TARGETS=1" + fi + if [ -n "${KSELFTEST_SKIP_TARGETS}" ];then + export KSELFTEST_ARGS="${KSELFTEST_ARGS} SKIP_TARGETS=\"${KSELFTEST_SKIP_TARGETS}\"" + fi +} diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index c0a032e..2d06543 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -143,6 +143,7 @@ cat >>conf/local.conf <