From patchwork Wed Nov 26 13:02:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac True X-Patchwork-Id: 4644 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 26 Nov 2025 14:06:55 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f55.google.com (mail-ed1-f55.google.com [209.85.208.55]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5AQD6sjY012376 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 26 Nov 2025 14:06:55 +0100 Received: by mail-ed1-f55.google.com with SMTP id 4fb4d7f45d1cf-6407e61783fsf6812593a12.0 for ; Wed, 26 Nov 2025 05:06:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1764162409; cv=pass; d=google.com; s=arc-20240605; b=KraqzwDPqla+hmpzE0dd2EnLN5+wfy2sjWJD5RsuJa3S5PzYME/sVdFr6RcxO5Nol9 2AJJl0gglI2jpyer4gZMwLnV2HoC1S4YC2kXgBWD0Q8U0c22x6R2BOQVvkUAZgBSttqD UUbZMQDJLXGBqj8mjmVYZntrEsImxWzRTytLAiTm+KPvK0WcM7AmYzFllcEYv2k08UR5 rCPJPmj0J5s36wlGJxbuNC79hhhYo/2Bvl+JSDEaUSRzx76EOfcqeI0hyhynV8PsRKIE c8Nj1XtuFEnZypS5onopCmqAzBDLZgFpbSHpWe/NZzNru/l/R5gwX2wjZQX/pIGOW6kb Hypw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=47mVMMEHl5uSPfcoNXOUFlXPDpMsfPVIGinZdspF4+c=; fh=7uYtVA/Mi8SViaxqozhPC1/mOGvkuIXr6lN7uuwr8qM=; b=ThmILC5kC2Ec7jOiMxsudcLhOP+eE+7pbCFnyeaZgVWMnK7lPS32HIQtGCh830ealM qU+M1ddVxBoT9fRW6OhywTC8FcvyJLRUbxd6+6jcuQ1rYXZ31xQ1pAwN/vylBB+W1cY3 FDaeUnZfl9vqaZ5zHt+kAnvcxVszV7ZXrLVOFyQQAxGOIUs6ZgHqrq/aRjsQuqz27kiM 13EM5dz/IAriXSwmKQt4iRh+ebVUIQcWgNDV0Tp6ivhhINMN3vLYcUCkDR8CQNJwx0ma NO+SVhIbba8E6FB2wV7DOxGLK2Z18GeT+cUCB5Xu16I3NWdnhxAyxBu2dkwQXEwhj90Q /Chg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1764162409; x=1764767209; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=47mVMMEHl5uSPfcoNXOUFlXPDpMsfPVIGinZdspF4+c=; b=RE2spZwi/aKKsCCLyjf0tdJxLxQ6ngV3fwg4DUY9LHaq+rLtJJ+uqSUbhSw+2nUs9B tkhJmJMNYBnGRFK25r9Ir9zcmR6SDoZRSuN3m3BLfQdjrCcq/nOqqmftyLQCuMV+wXXQ 1uMbOrWXIWjeRgbBL1zJwUGuKnH0LGC3xqj5a2AhDhBunqRhL33HXdGHVZFb1Y4j60A6 lm0cYKtSiLPI+RVmskkYSImi1cgkJg0hLwMU3YlWDkxEsrcyhOhO0FHYUo8UTiRevq0T BqQmL8pznxvOMFBYt0HKSdSPWTReE1QHmcP0wgBp3URHXwXXm/MmBYfjHf1C2sxuj5+y xoaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764162409; x=1764767209; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=47mVMMEHl5uSPfcoNXOUFlXPDpMsfPVIGinZdspF4+c=; b=ueYtilf9aC68P/6RE4+5yvwKiol2uqvqhQQ3chEfQmH/C/e6hb4y2ui584KA+jdaKt gwqviDSkaaQdOJJBUbRsZibK3m86IW/fIZGnSTUt/8TyEITNILyLw923/c04KxdB9+Af oXPpmj9Q3dj5o7HW5R0ZD60SRpw0P1BAP9Mfo7xVlB8MlpCaL9YxR/dStY8wZlDPdJ4W iWczBfz7uUKBszfgPWSAfy/J4Mf4Vj43Ox0EVNh8D0t06V0sLFqlhv9ZBPlbyxYjmkBb ZqCiUpVS9J7VQJ1VcFdnGSFoI/5IMcup9MgCQ9G3A12K0gl9/fQrM28BCUI+X2e6H1S3 sAxw== X-Forwarded-Encrypted: i=2; AJvYcCUSu+zzwnamuuv8tNsOIeD14IFmgIqmdoLIxeK1l6WFO7iEjMCQSgunPNX5/nzlGoLQy6+1Svs=@isar-build.org X-Gm-Message-State: AOJu0YxOrvCjnLivhYZfg3MCqDoEFSVs+PNlylhRJuEpzhGw4mCzCSPS ij+ydzrHaz6MSYWP5n4Qiuse18CU0nXedm3Uyxt/snWgvDk3BVNYNeFt X-Google-Smtp-Source: AGHT+IEakxPqYFmSy8ksb9hPeueSV9UWxAUrVsCTR8jsefex/THwS6Q9hMTwULyaFGC2Bjfd22fCzQ== X-Received: by 2002:a05:6402:350f:b0:640:a356:e797 with SMTP id 4fb4d7f45d1cf-645eb2648b3mr6275042a12.13.1764162409312; Wed, 26 Nov 2025 05:06:49 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+ZIrWt+herwBh0WnigCBLWO2w6/Ie1G/Lt/zy+1CnywjA==" Received: by 2002:a05:6402:3048:20b0:644:f98a:dce0 with SMTP id 4fb4d7f45d1cf-6453640f8c2ls1158353a12.2.-pod-prod-07-eu; Wed, 26 Nov 2025 05:06:46 -0800 (PST) X-Received: by 2002:a17:907:6e8b:b0:b76:26bc:f95f with SMTP id a640c23a62f3a-b76c50c2061mr682301066b.0.1764162406504; Wed, 26 Nov 2025 05:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1764162406; cv=none; d=google.com; s=arc-20240605; b=WqFlMBOYfla1N4GSC3LNsxJsJ55id36gi9w0BWw7tcUffyyto5j2/l2GkhnC308hvw c1y9JurqkkMngrxyxNb3V2n7JLcd8N3+zAjcInAoWTsm2bhMDdKbE4BfRq9q2Vmje0Pc iE+dnG6G+McE97ODutZ4gWscj98ug3ZiTi3FZVUUrFgbgbOq8ntMofOwr+3oHkd998W0 ZwWCfHcDHI3Lu+ACCXfx2SgIcWkB+RlqGspQe3dlaWchRreZwkv+wMvkmnAhgWJy49RS K9urz1rjVCfSndI4wxXkDpuptiKBzpqhA7hIX/qFXbx+riFs71qrh8CbW4wOmYN7l4V1 7rvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=EuWMQuWGnDfPSQ7r12McY5hUOadHT2xIuhrVE21m/lU=; fh=vRrjvjDC0Nm912rKb+hserwyuGVHai4IaHlHCTH5jzE=; b=jn1qdKAH0MbpMISDn19Ksscxjo2Wb1rJGhKXacrxnzBpQCmhNSTL+zurGP/s/bor/F FGzau5RRh2AX5L/c1XrS0+f9bTfW6z/rpdNZ+isyRtWiGRmSG3LoiKRMXc/5yrD3iGXp YD9zm3H+xFizKlCbhWcrYsxhB+FyShSHJLgI60htY7CILvaeaceVnInmK/pRGVcGMwfI 6IYYT2ZfGTyw3/LOZJYsda+qdeipKO8esN/EHF8X1mHeyH8nGF5HUgYKK5HetYHmzit/ K7oMAj3xlum202Bj4ittQ8Rt7GUZpWhBjwclHJb8lK10hc9OEi9Ytims2uyvgMN5bUQ5 Fbdw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com Received: from mx1.emlix.com (mx1.emlix.com. [178.63.209.131]) by gmr-mx.google.com with ESMTPS id a640c23a62f3a-b7654fc8ea2si43102166b.2.2025.11.26.05.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 05:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) client-ip=178.63.209.131; Received: from mx1.emlix.com (localhost [127.0.0.1]) by mx1.emlix.com (Postfix) with ESMTP id B33545FADF for ; Wed, 26 Nov 2025 14:06:40 +0100 (CET) Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 9DD2E5FC39 for ; Wed, 26 Nov 2025 14:06:40 +0100 (CET) X-Patchwork-Original-From: "'Isaac True' via isar-users" From: Isaac True To: isar-users@googlegroups.com Cc: Isaac True Subject: [PATCH v2 1/2] linux-custom: add linux-tools package and build perf Date: Wed, 26 Nov 2025 14:02:28 +0100 Message-ID: <20251126130534.3484253-3-itrue@emlix.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251126130534.3484253-2-itrue@emlix.com> References: <20251126130534.3484253-2-itrue@emlix.com> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-Original-Sender: itrue@emlix.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; dkim=pass header.i=@emlix.com header.s=20250930 header.b="q+9/r7MJ"; spf=pass (google.com: domain of itrue@emlix.com designates 178.63.209.131 as permitted sender) smtp.mailfrom=itrue@emlix.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=emlix.com X-Original-From: Isaac True Reply-To: Isaac True 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-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add an additional package to the linux-custom recipe which can be used to deliver tools built from the kernel sources. Additionally, build the perf tool as part of the kernel build process and add it to the linux-tools package, allowing users to install it to their target rootfs. Signed-off-by: Isaac True --- meta/recipes-kernel/linux/files/debian/control.tmpl | 10 ++++++++++ meta/recipes-kernel/linux/files/debian/isar/build.tmpl | 3 +++ .../recipes-kernel/linux/files/debian/isar/common.tmpl | 2 ++ .../linux/files/debian/isar/install.tmpl | 7 +++++++ meta/recipes-kernel/linux/files/debian/rules.tmpl | 2 +- meta/recipes-kernel/linux/linux-custom.inc | 10 ++++++++++ 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl index ee87cf92..edb3960a 100644 --- a/meta/recipes-kernel/linux/files/debian/control.tmpl +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl @@ -69,3 +69,13 @@ Conflicts: linux-kbuild-${KERNEL_NAME_PROVIDED} Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@ This package provides kernel kbuild scripts and tools for @KR@ This is useful for people who need to build external modules + +Package: linux-tools-${KERNEL_NAME_PROVIDED} +Build-Profiles: +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlib:Depends} +Description: ${KERNEL_NAME_PROVIDED} Linux tools for @KR@ + This package provides kernel tools for @KR@. + . + This is useful for people who want to run things like perf. diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl index b4c105c1..72edfa42 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl @@ -23,6 +23,9 @@ do_build() { if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then # Build kernel scripts and tools ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" + if echo "${DEB_BUILD_PROFILES}" | grep -q "tools"; then # Build kernel tools + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" -C tools/perf + fi elif echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then # Build kernel scripts and tools ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts if grep -q -E "CONFIG_STACK_VALIDATION=y|CONFIG_HAVE_OBJTOOL=y" ${KERNEL_BUILD_DIR}/.config && [ -d "tools/objtool" ]; then diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl index f9cc2f02..a104784a 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl @@ -12,6 +12,7 @@ KERNEL_PKG_LIBC_HEADERS=linux-libc-dev KERNEL_PKG_LIBC_HEADERS_CROSS=linux-libc-dev-${DISTRO_ARCH}-cross KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED} KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-${DISTRO_ARCH}-cross +KERNEL_PKG_TOOLS=linux-tools-${KERNEL_NAME_PROVIDED} # Force creating debian package with valid host arch for -native build # Use a cross build to comply with arch specific kernel defconfigs @@ -38,6 +39,7 @@ deb_libc_hdr_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS} deb_libc_hdr_cross_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS_CROSS} deb_kern_kbuild_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD} deb_kern_kbuild_cross_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD_CROSS} +deb_tools_dir=${deb_top_dir}/${KERNEL_PKG_TOOLS} # Array of packages to be generated declare -A kern_pkgs diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl index 6fa94508..76d238a0 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl @@ -68,6 +68,9 @@ do_install() { install_dtbs install_kmods install_headers + if echo "${DEB_BUILD_PROFILES}" | grep -q "tools"; then + install_tools + fi fi # Stop tracing @@ -137,6 +140,10 @@ install_dtbs() { ${MAKE} O=${O} INSTALL_DTBS_PATH=${deb_img_dir}/usr/lib/linux-image-${krel} dtbs_install } +install_tools() { + install -Dm0755 ${O}/perf ${deb_tools_dir}/usr/bin/perf +} + install_kmods() { [ -n "${CONFIG_MODULES}" ] || return 0 ${MAKE} O=${O} modules_install \ diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl b/meta/recipes-kernel/linux/files/debian/rules.tmpl index 598ae93f..a3b25396 100755 --- a/meta/recipes-kernel/linux/files/debian/rules.tmpl +++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl @@ -45,4 +45,4 @@ override_dh_strip_nondeterminism: true override_dh_strip: - unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu --no-automatic-dbgsym + unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu -Xperf --no-automatic-dbgsym diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index ccbea976..df862ef3 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -169,6 +169,14 @@ RECIPE_PROVIDES:append:libcdev = " \ linux-libc-dev-${DISTRO_ARCH}-cross \ " +# Set to "1" to enable the tools build profile and build the linux-tools package +KERNEL_BUILD_TOOLS ??= "0" + +# Provide the linux-tools package if the tools build profile has been enabled +RECIPE_PROVIDES:append = " \ + ${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.tools'.format(d.getVar('BPN')), 'linux-tools-{}'.format(d.getVar('KERNEL_NAME_PROVIDED')), '', d)} \ +" + # When cross-profile is active: # kbuild package is provided by -native or -kbuildtarget variant. Also headers # provisioning moves over to ensure those variants are pulled, although the @@ -231,6 +239,8 @@ def get_additional_build_profiles(d): profiles += ' pkg.{}.nolibcdev'.format(d.getVar('BPN')) elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')): profiles += ' pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')) + if bb.utils.to_boolean(d.getVar('KERNEL_BUILD_TOOLS')): + profiles += ' pkg.{}.tools'.format(d.getVar('BPN')) return profiles KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')), 'all\nMulti-Arch: foreign', 'any', d) }"