From patchwork Sat Jan 4 19:08:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "cedric.hombourger@siemens.com" X-Patchwork-Id: 3994 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 04 Jan 2025 20:10:18 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f61.google.com (mail-lf1-f61.google.com [209.85.167.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 504JAHtE001233 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 4 Jan 2025 20:10:17 +0100 Received: by mail-lf1-f61.google.com with SMTP id 2adb3069b0e04-5401af85378sf4929236e87.2 for ; Sat, 04 Jan 2025 11:10:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1736017812; cv=pass; d=google.com; s=arc-20240605; b=dANKD12u9cU3JVzLSGj7TUJJRFgMrU+r2kJTK1ErG2K+/BoLrGAzoQnoWET/7s8RZ2 CcnZIQOaPswXu7SckXD9XeorZ/napuYgTPknWCZ8ByKE4kwFncSR7mIYZ58FVnmErfta Fk+yvRDjPVNQQ+7Sp/aH3yhvA4TSaaj1Cd0dokZ+xHL1TLzqEmdOoJd7VMNyMgr/UJB5 PMR4H66EIN6RO94y7Q/t1Mgy3MdjdadPqkduoXNHMjumjID4grFf/qL666AwTyDIIZ11 sfUhQIqZVmdE66552Do4fNAttGmElrHfrM51GVgOHoEsdueojCDFNQ8OqAH4M+V6NYXS DdEw== 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:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UXFjcLnHe6O6Vgg3kDJLVDhZezrXYPGheKF/vDIRVz0=; fh=j7cATbDzvk2oipG3PAMFC+kxbJRUCqpoZOSCjA6lyM0=; b=i8K7nI++Hd178fS0kRA9ScT7dEpDP5xIT9UclmkTzYDExBMUG5xxPfn7Tjz5CjiJuz GIVwiXkafDbvpxgj1V8fHA4csf6Ni3XjBIQzkd3+dAZNTnC/T4OASIULjSrJHII+/prX fqSO2+HSxB9EGm9fruvsLeF9o7uyim4B2q9BJJWH7HXPyvMzLmYj/rSeTsLxcrHj7jqL Y9JxLkLwabijFlZ1TVFYCTTjTXu/xuJ9j04vVh7Afeg6AA1RIO4q3JStN6M+Z2vuGp0R VTiNrk9dbXBhCODUvAzG8rN0qWhFYojJP4RHiBNJqajuaodAiNqBQp1Msh8rqBVzsu3n SozQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=GP8Hd1FE; spf=pass (google.com: domain of fm-1212295-20250104191007a390ab52c778abaa81-vzb4kt@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-1212295-20250104191007a390ab52c778abaa81-Vzb4KT@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1736017812; x=1736622612; 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:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=UXFjcLnHe6O6Vgg3kDJLVDhZezrXYPGheKF/vDIRVz0=; b=tHOudPojJOYGO8ZwqRbqQSSYXhkDiCmclyufE9gTRQYr+Mh9HSa0V+5RzJGFa2D1R3 OPUu9n60GbNpquTK2cbVMaN8uM9uFGzpPb93L9RZi7L3vdiOyIL/CjTZftSiIgHIGU4S wKzDRimZhMx6Uj2RyDnSUJXgjl24rCQxWEGiDLToK6Jc30n/NNMZiGbgXsnGdh9FIeBs QpGZoeI8iyKNDGnQd7FaVTDWuCynxlWCAC+mOJWLhw68n9aJf8//adA9PFeyKQZP04ma kxKLXj2IsDlZDyLyILEMwLLl+9OQgEvdNDq29tLQ6TrE/h8akdRRxBneyyUELkadeXFi KGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736017812; x=1736622612; 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:feedback-id :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=UXFjcLnHe6O6Vgg3kDJLVDhZezrXYPGheKF/vDIRVz0=; b=XaVkYo6mA+5s0P+RPROEz3k8NIlQ4vqgP6V3h3R2XgBxchaS60xmc0ySgdHLiH0eYu f/4ptfZyNNNhTg4SAkSA3jkW4CzKjMHkiQIYxhfuBzTleRFUqVUePU9cIFAhU+jjNqBY O5jrMLXrPADcqNgsl1S9PoNcc2Z3CPKc8bnntB45T9nTjBmbPe86ov8G+nLN7Oc/3Jzi VY37Dpys7KMwCrN3R/cr6I6az5efRwqlhdBSfXROrbxqqSXgF7feQ/1lCZdwyR4vzNwm VZ/coGjEX92U5tppDBQgokY4lWYOwNlZ5YwrwD3HVQMQSF2FLHvbFiTvHZuR62BubaVu Npmw== X-Forwarded-Encrypted: i=2; AJvYcCXlYVpqFxhUUyCvvCyUpTjBnYwG6y3IfhAVCEntiDmG2Ulg4FZ1FgJ9g1B3oxjt/aWdp0CerL8=@isar-build.org X-Gm-Message-State: AOJu0Ywau/5Kq1NRvNvNPqWoO+Mifl2FSFMAdrWu1iGeWJt2aflZWPRU veaGx142T4Ekk5NEoiaupNTbEU4CyLsX6JzfSRUYDC3moA8Beugn X-Google-Smtp-Source: AGHT+IEqTHtfr4E3OrrLxgBIyoyho8EynlR9RNYVgWO/PHX/mIvxlB63AkVI9u5Jsj7NFGPQQtwSow== X-Received: by 2002:a05:6512:3d02:b0:53e:350a:7294 with SMTP id 2adb3069b0e04-54229591104mr18066376e87.37.1736017811017; Sat, 04 Jan 2025 11:10:11 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:7706:0:b0:541:1c48:8c0a with SMTP id 2adb3069b0e04-54221015292ls190298e87.0.-pod-prod-05-eu; Sat, 04 Jan 2025 11:10:08 -0800 (PST) X-Received: by 2002:a05:6512:2809:b0:542:2871:535c with SMTP id 2adb3069b0e04-54229539f85mr15580839e87.22.1736017808491; Sat, 04 Jan 2025 11:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736017808; cv=none; d=google.com; s=arc-20240605; b=ZHpf3cLdhZj9U5O+RsRBklc1jrkALWbDcvN8jRg4uKhdZAxM5vq+LFgB+nqLMZdjTC sotzwdlNBhM5KSwbpmLhg3/G08fSuZyZHBdkMHqN3CKYkh70KtUo1izvnHIVmQt12VhQ o2uWODJuAuiDpac7q+HK8t++xPbwZJWbK6n8895668xW7CgixxDsNmc7kifY1K1L+Eo7 dM9a1uxhw/9+ak8MpGRW5Xxz0t9pD357m/DQbbVTMyoff2FLRV0FhJbPBL+cPjO4Z4eO T6Yk8JggTiV981Cc+CRczFB3lf+I3aRr5lC8xFBXNxGSw5Chbxp4xel/ERH7r+GLWXvk toKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=MhEajI4gTUJ0Eyzqos+OvUQIOEg0hLCI4TE4FtKXsIU=; fh=Dd6DDhoctkR7blqXCb8g8Xq9g0XIxGnNMKT2Keb5FW4=; b=YqGrVFcnDPW/2cYJKuPmHPPGHdiviF+mL/Rx7Aqlln9qGE8t5Yj4W5LihIuUH92gii ptdARO1VmSKRDXVZcbo/PlF4a74MX4dP/7RqGuMJeDA2rUxawE96lPd040Lh7qR51W8H VjRrSArVHT/kX8G8p8BsbmCB2WuAFLPHaYagTPeg40cdHPK7c3nPr8cDhuMJuRLECJMb xMWw8wc422nvfBKRklhF97W0I5Lr0228tH0lRlRIi8Yupdd1u7MIE5vqQL2Rskm4n3ya WX/iMzvt6v2S23yW4B4W4y05oLZQChqotrSmvPcea37bq/YO12A8DCox/xQZ71eavX4T sl9g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=GP8Hd1FE; spf=pass (google.com: domain of fm-1212295-20250104191007a390ab52c778abaa81-vzb4kt@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-1212295-20250104191007a390ab52c778abaa81-Vzb4KT@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-542235eb772si728729e87.1.2025.01.04.11.10.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jan 2025 11:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1212295-20250104191007a390ab52c778abaa81-vzb4kt@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20250104191007a390ab52c778abaa81 for ; Sat, 04 Jan 2025 20:10:07 +0100 X-Patchwork-Original-From: "'Cedric Hombourger' via isar-users" From: "cedric.hombourger@siemens.com" To: isar-users@googlegroups.com Cc: Cedric Hombourger , Arulpandiyan Vadivel Subject: [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie Date: Sat, 4 Jan 2025 20:08:58 +0100 Message-Id: <20250104190859.1879934-1-cedric.hombourger@siemens.com> In-Reply-To: <20250103072928.45916-1-arulpandiyan.vadivel@siemens.com> References: <20250103072928.45916-1-arulpandiyan.vadivel@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=GP8Hd1FE; spf=pass (google.com: domain of fm-1212295-20250104191007a390ab52c778abaa81-vzb4kt@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-1212295-20250104191007a390ab52c778abaa81-Vzb4KT@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger Reply-To: Cedric Hombourger 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?= The linux-libc-dev package that comes with Debian trixie includes arch-dependent headers for all supported architectures and has its Architecture set to "all" rather than "any". Match this behavior when both KERNEL_LIBC_DEV_DEPLOY and KERNEL_LIBC_DEV_ARCH_ALL are in effect (the latter defaults to "1" for "trixie", while the former still defaults to "0") Reported-by: Arulpandiyan Vadivel Signed-off-by: Cedric Hombourger --- .../linux/files/debian/control.tmpl | 2 +- .../linux/files/debian/isar/install.tmpl | 37 +++++++++++++++---- meta/recipes-kernel/linux/linux-custom.inc | 6 +++ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl index f4273ea9..ec0da1ab 100644 --- a/meta/recipes-kernel/linux/files/debian/control.tmpl +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl @@ -26,7 +26,7 @@ Package: linux-libc-dev Build-Profiles: Section: devel Provides: linux-kernel-headers -Architecture: any +Architecture: ${KERNEL_LIBC_DEV_ARCH} Description: Linux support headers for userspace development This package provides userspaces headers from the Linux kernel. These headers are used by the installed headers for GNU glibc and other system libraries. diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl index 0a7bdd66..6d742f02 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl @@ -5,6 +5,16 @@ # Load common stuff . ${S}/debian/isar/common +get_kernel_arch() { + case "${1}" in + amd64|i386) echo "x86";; + arm64) echo "arm64";; + armhf) echo "arm";; + mipsel) echo "mips";; + riscv64) echo "riscv";; + esac +} + do_install() { # check if our kernel was configured @@ -165,13 +175,26 @@ headers_check() { libc_headers() { mkdir -p ${deb_libc_hdr_dir} - ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr - host_arch=$(dpkg-architecture -a${DISTRO_ARCH} -qDEB_HOST_MULTIARCH) - mkdir ${deb_libc_hdr_dir}/usr/include/${host_arch} - mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${host_arch}/ - - mkdir -p ${deb_libc_hdr_cross_dir} - ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${host_arch} + arches="${DISTRO_ARCH}" + if echo "${DEB_BUILD_PROFILES}" | grep -q "libcdev-arch-all"; then + arches="amd64 armhf arm64 i386 mipsel riscv64" + fi + for distro_arch in ${arches}; do + target_arch=$(dpkg-architecture --force -A${distro_arch} -qDEB_TARGET_MULTIARCH) + kernel_arch=$(get_kernel_arch ${distro_arch}) + [ -n "${kernel_arch}" ] || { + echo "fatal: don't know the kernel arch for '${distro_arch}'!" >&2 + return 1 + } + ${MAKE} O=${O} headers_install ARCH=${kernel_arch} INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr + mkdir ${deb_libc_hdr_dir}/usr/include/${target_arch} + mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${target_arch}/ + + if [ "${distro_arch}" = "${DISTRO_ARCH}" ]; then + mkdir -p ${deb_libc_hdr_cross_dir} + ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${target_arch} + fi + done } kernel_tools() { diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index e825d29b..77700a5d 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -39,6 +39,8 @@ LIBSSL_DEP:bullseye = "libssl1.1" KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, \ ${LIBSSL_DEP}," +KERNEL_LIBC_DEV_ARCH_ALL = "0" +KERNEL_LIBC_DEV_ARCH_ALL:trixie = "1" KERNEL_LIBC_DEV_DEPLOY ?= "0" # Settings that may be changed on a per distro, machine or layer basis @@ -79,6 +81,7 @@ TEMPLATE_VARS += " \ KERNEL_BUILD_DIR \ KERNEL_FILE \ KERNEL_HEADERS_DEBIAN_DEPENDS \ + KERNEL_LIBC_DEV_ARCH \ LINUX_VERSION_EXTENSION \ KERNEL_NAME_PROVIDED \ KERNEL_CONFIG_FRAGMENTS \ @@ -214,8 +217,11 @@ def get_additional_build_profiles(d): profiles = d.getVar('BASE_DISTRO') if not bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_DEPLOY')): profiles += ' nolibcdev' + elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')): + profiles += ' libcdev-arch-all' return profiles +KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'libcdev-arch-all', 'all', 'any', d) }" DEB_BUILD_PROFILES += "${@get_additional_build_profiles(d)}" do_prepare_build:prepend() {