From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7163980406052618240 X-Received: by 2002:a1c:6a09:0:b0:3fe:f74c:b4f6 with SMTP id f9-20020a1c6a09000000b003fef74cb4f6mr3129384wmc.17.1696436136079; Wed, 04 Oct 2023 09:15:36 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:511e:b0:405:8e:cdfc with SMTP id o30-20020a05600c511e00b00405008ecdfcls946171wms.1.-pod-prod-09-eu; Wed, 04 Oct 2023 09:15:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmRRvUqmWjdZdfXeGF0acHze72kF2G2FW+v0DerqcPu5tvACZjUnZ7+P1fJ14QEmF+F35C X-Received: by 2002:a7b:cd8e:0:b0:405:3a3d:6f53 with SMTP id y14-20020a7bcd8e000000b004053a3d6f53mr2349694wmj.3.1696436134033; Wed, 04 Oct 2023 09:15:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696436134; cv=pass; d=google.com; s=arc-20160816; b=ZnHS2RjCwjj3xWmpgxdZkVc4eYVZYhD/ra8VDSgMBS8bzySUtQhr1rj5uPpkNaj/Pq Mvdb46zAgLjcmyrVSfAe09F4lTmCWiiA0JCs9m5/Yk1J2hPAq/fE6UheNjXiWlpwncXs YFuRHVhjqimlbiVM0YtQ4twy6D1BC2e3Y5TvoOELiJf5z9wBz7vkSErHKs8xKm1EL/Oh 2bUQTv01u5O87uRmEAjjCF1CmJURKEaxWzIgUM+huC1fe1jM0cVw5nadDGfmJOAaXLPL s0fe5PFCcIfs+NeM8VHT5eZlzTyq4J8Q6v8vUUHSM9ViK2SKN1t74DXvSLQLa8y5Zuhc eS+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:in-reply-to:from:references :cc:to:content-language:subject:user-agent:date:message-id :dkim-signature; bh=/KNGk0fpWsi0NPUgmHe6Ug9WIzzyaU0KvyS+lDyAw6M=; fh=R6HrWdWlj57JMeqckvdS2+8ih9Iow3FGaQuqx4ZhyLg=; b=fLTDrOr3oIlYZkL9+uero9ccn12hJJh1XbfkhOIlCE7aBWyt3V9whOYjtN/RyU4M+T Xi0ep91qHfCrP530bN81wzYb0aXYo1eA6dKTDbs5iGMhvESJ5YD3hTueK9CNWrA5VVIm qFuiCKGR6d9iCcL0q9hdjSa1n0g40L6otkQzvm+UcpHnjjx/aneCBnuXm+H+kfjadHBh ueOQog0BDGRDfntYPPJj549eY9FQ3wIhSiLUmKKsTg7OlNRL5VESavSSGyvmGWEsHQVo mWoajiJ9smOM9t+vYp2RbU94gzaxWorVsVf5NNfgCkw1laY6zm9daucx9ZxBhNjk31Tx OTKQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=HcJq3cgL; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:7eaf::624 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on20624.outbound.protection.outlook.com. [2a01:111:f400:7eaf::624]) by gmr-mx.google.com with ESMTPS id fm18-20020a05600c0c1200b00405c7dd428csi126492wmb.2.2023.10.04.09.15.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2023 09:15:33 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:7eaf::624 as permitted sender) client-ip=2a01:111:f400:7eaf::624; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=HcJq3cgL; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f400:7eaf::624 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dWNV9pZdYkk7XTVyAno+f43CfAX2B6Ukk7lKJid6GTjb53KbJlacMi4awpH1e5urAocp1nCCM/jC6bmdSEuMGrREzz7CSMtK/eiuXVhzbVALuCNSEcw4EBph3hGEf+5az+B+5Kz3irRZXza5CTBEfTenJdz5DyiwfmXeL0NjyIayNB+5WTg2m9gXVjI6Gd55JDvDDO28gIiv82kFFJUSeVUb8FRmq2baZ/gqEh8CK9M4N7LtaiHcJ1g2VGFtzwhFRCeqqzAy2eCzJL8ZGGQuRVxREs5OItc/TZER9W2Dsa3M1mmcbcoNTbHV/5fU6f7YWiq5jdhnN1EDNXtepKghZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/KNGk0fpWsi0NPUgmHe6Ug9WIzzyaU0KvyS+lDyAw6M=; b=bhR5ikeW5FEfvMDbdDBeEEwqt8D+Jdc86YPyOqP9RtaICCNPP6qEvd71oHu2uX0K9qe+FyGbnxR9iidADFoesP+lS2YeSsz2FyUBBUpE7hx5bmx9lXaJ9GppCW3hCzbiij3GzD8TKAdUYgSkIlqj6SETJYIswsQ6Wzt/uKy/spU3xaI95CK5cn4Dydb4OOJahzhRyrjkcTvO/bHW9KQm+ENVaX80IefGSw10psPxNWWb5hf32VHBBR0xusdPIFrTvWb/YjyzVtLRvOhCztbrDBFqPB3T3LsaGQ4VH4QZIqsJRhCuDMa4cbuWBl9osoAd3d49UbT8b37dVECubgtinA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/KNGk0fpWsi0NPUgmHe6Ug9WIzzyaU0KvyS+lDyAw6M=; b=HcJq3cgLqGn8wd/Gxujj6UcTbuhj9Dur3UHLq3pAFB/5Zmryovfs8o9Goy+/SGPRLzm6E3mFJ2IZfz7UEMuhe4lN17WJ4gFRrd4BUzp/PZ+bVqLtdLCKSfFLsugbZwc/sfKf4QaSBVxIof+M5lUw3lhP9HM5N7jS+sfYmeVmm0eVcmLR42Pr2nEo/x0oQQ0UvkKdbbx/sl7FrQDUAxLzpRqIBguSm8sZmRUa7IYUDXbM3pdnaelpMV1N48Gl86nh38oLV6uqBQVFwxioVHbeVL/TZmRtwEAchHwW75OyxsVPl4b1O3n645CYBN2B+kEAjveLlOMTnS3PMeT9NWpeQg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) by AM7PR10MB3810.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:14f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 16:15:31 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::7f20:d403:b43d:12e2]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::7f20:d403:b43d:12e2%3]) with mapi id 15.20.6838.033; Wed, 4 Oct 2023 16:15:31 +0000 Message-ID: <06d00365-cdf8-43b1-9040-f878304c67ce@siemens.com> Date: Wed, 4 Oct 2023 18:15:26 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/3] linux-custom: Provide host and target specific kernel kbuild packages Content-Language: en-US To: "Koch, Stefan (DI PA DCP R&D 3)" , "Schmidt, Adriaan (T CED SES-DE)" , "isar-users@googlegroups.com" Cc: "Sudler, Simon (DI PA DCP TI)" , "Storm, Christian (T CED SES-DE)" , "ubely@ilbers.de" , "Adler, Michael (T CED SES-DE)" , "MOESSBAUER, Felix (T CED INW-CN)" , "Hombourger, Cedric (DI SW CAS ES LI)" References: <20230821134501.2681654-1-stefan-koch@siemens.com> <20230821134501.2681654-3-stefan-koch@siemens.com> <4219214b9eedad7eac3f399b9dc896282a5a2202.camel@siemens.com> From: Jan Kiszka In-Reply-To: <4219214b9eedad7eac3f399b9dc896282a5a2202.camel@siemens.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0064.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::8) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) Return-Path: jan.kiszka@siemens.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|AM7PR10MB3810:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ed3cc81-f36e-46a8-ccc3-08dbc4f52174 X-LD-Processed: 38ae3bcd-9579-4fd4-adda-b42e1495d55a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DP1/eOxOZMcOWU0Zsqj4va4qWUxu5M/+W5jL+feS65EOwv93Twx5ewnzGrSPCcoqMNk+acdSwJ5oLy+fIKhG9KqaYcP4vVDAwFhqy4mpiz1v+ORnrnZ2GpxwWh89rWtdyoquCosMSrBMHNbTZPXwsSV0wCO8rHo4w5NDJe2fQfcSSNBJWMMZaDEZwmrG9zgj3at0SSMD4Ujh40RoS7Qdgg+ezUsDvBfP9VBMkGNfmfn6UyPcK/SYmgozpjpPX1SPHK8z2sgqFpO3Irlemz0lWROFg3CBrZXqkltAjsnT5Psz3X27/q/Y2aEcWU6UEnhQXcnIjSZYyUSAbko+0Zy4TrEHPgp6ubv8Lyi/CCWikyyI1/HNhCL0vgooH7hr2PiJ+CZ20fFZJ4upglOeOHZotxt41G14ywBHieWoxgy+goQGEsXgc2JTo9SM5dRHghrMoZ6Np10R694XPxWhP7mTqN86yFhbJCSxFneR59j5Wqt5UfLisMluE8EBw8OT+rxagTGi8QiLHgSAYPdjsiX04GAm8/U+MQbzo3hmCFNkll2Er5SV1oayD8EkVUozJ5EklsFjSIAeFzM3vZUZxuU6uu23TeWHHe3NpxuNAvAnbIUiW5UtM4ShsjtpcpvRjYthvH38pC5Ac9ikzwt2dJsPBA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(39860400002)(366004)(136003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(31686004)(6486002)(6506007)(53546011)(6666004)(478600001)(966005)(6512007)(82960400001)(31696002)(86362001)(38100700002)(2906002)(66556008)(26005)(107886003)(2616005)(83380400001)(316002)(30864003)(36756003)(66476007)(54906003)(66946007)(110136005)(5660300002)(41300700001)(44832011)(4326008)(8936002)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?amhyeGpIQ1BWSmtyYVJZQXpiZ1luRFczdU9QSko5NnAwOTVmS3FIczdaS0xp?= =?utf-8?B?Ym83dUZVelBuYjVhZncwbVZIaklJOVZqRnBsZUlWaG1kYmNNZndkaVQ2V0VH?= =?utf-8?B?OGs5SWZqSlVCaU0xSG12YU5VSytBMFF5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x5OGdhUE5wbGFjR2ZLZGlrQTdHYU1ES2Q1SjRLaEExdURDOUNIRjBwTWxP?= =?utf-8?B?U2dkRVphZzhhaDZHc3NwYTJ0RWEvQTVucmt0aXpzNkdDRS81RHdFRlVCb1E3?= =?utf-8?B?eS9vdWVrNXdZcWV3eVBYajM4SzUxWWtwZzBXSWgvSmJPdXV1WUhhSGRCSm1V?= =?utf-8?B?bC9xbFhENE9yOEllQSsralBXTXZ6K1BmamhRNURxdDI0SlpTYUpxeWFaWGYv?= =?utf-8?B?aXc9PQ==?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ed3cc81-f36e-46a8-ccc3-08dbc4f52174 X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 16:15:31.1698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kPILXmqxrEozJR8CJ+eyvw3s+wo8pJTXCB3fvwFBqV2toRc3JqYzVi0mc7XKmIxz4YCkV1Mw3s56AjUpKtIdyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR10MB3810 X-TUID: 7K1gO6dMD7qK On 04.10.23 17:34, Koch, Stefan (DI PA DCP R&D 3) wrote: > On Wed, 2023-09-06 at 06:38 +0000, Schmidt, Adriaan (T CED SES-DE) > wrote: >> Koch, Stefan (DI PA DCP R&D 3) , Monday, >> August 21, 2023 3:45 PM: >>> When using a cross build this patch does introduce optionally >>> host and target specific kernel kbuild packages that >>> ship the "scripts" and "tools" binaries. >>> >>> By default at cross builds a kbuild-cross package will be >>> generated that provides the host specific kbuild package. >>> >>> The "-compat" and "-native" multiarch bitbake targets are useable >>> to run >>> additional target or host specific builds for kbuild scripts and >>> tools. >>> >>> Using the "-compat" bitbake target enables the build of >>> a target specific kbuild package at cross builds. >>> >>> Using the "-native" bitbake target enables the build of >>> a host specific kbuild package at cross builds. >>> >>> This solves this from doc/custom_kernel.inc: >>> - The kernel headers package has not supported both native >>> and cross compilation of kernel modules when itself was cross >>> built >>> - Future roadmap: Generate kernel headers package for both host >>> and target when using a cross build >>> >>> Signed-off-by: Stefan Koch >>> --- >>> .../linux/files/debian/control.tmpl | 16 +++++- >>> .../linux/files/debian/isar/build.tmpl | 12 ++++- >>> .../linux/files/debian/isar/common.tmpl | 8 +++ >>> .../linux/files/debian/isar/install.tmpl | 26 ++++++---- >>> .../linux/files/debian/rules.tmpl | 2 +- >>> meta/recipes-kernel/linux/linux-custom.inc | 49 >>> ++++++++++++++++--- >>> 6 files changed, 94 insertions(+), 19 deletions(-) >>> >>> diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl >>> b/meta/recipes-kernel/linux/files/debian/control.tmpl >>> index b19ca2c9..c012048b 100644 >>> --- a/meta/recipes-kernel/linux/files/debian/control.tmpl >>> +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl >>> @@ -6,6 +6,7 @@ Build-Depends: bc, kmod, cpio, ${KBUILD_DEPENDS} >>> Homepage: >>> http://www.kernel.org/ >>> >>> Package: linux-image-${KERNEL_NAME_PROVIDED} >>> +Build-Profiles: >>> Architecture: any >>> Depends: ${KERNEL_DEBIAN_DEPENDS} >>> Description: ${KERNEL_NAME_PROVIDED} Linux kernel, version @KR@ >>> @@ -13,6 +14,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux >>> kernel, version >>> @KR@ >>> files, version: @KR@. >>> >>> Package: linux-headers-${KERNEL_NAME_PROVIDED} >>> +Build-Profiles: >>> Architecture: any >>> Depends: ${KERNEL_HEADERS_DEBIAN_DEPENDS}, ${perl:Depends}, >>> ${shlib:Depends} >>> Description: ${KERNEL_NAME_PROVIDED} Linux kernel headers for @KR@ >>> @@ -21,7 +23,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kernel >>> headers >>> for @KR@ >>> This is useful for people who need to build external modules >>> >>> Package: linux-libc-dev >>> -Build-Profiles: >>> +Build-Profiles: >>> Section: devel >>> Provides: linux-kernel-headers >>> Architecture: any >>> @@ -30,6 +32,7 @@ Description: Linux support headers for userspace >>> development >>> are used by the installed headers for GNU glibc and other system >>> libraries. >>> >>> Package: linux-image-${KERNEL_NAME_PROVIDED}-dbg >>> +Build-Profiles: >>> Section: debug >>> Architecture: any >>> Description: Linux kernel debugging symbols for @KR@ >>> @@ -37,8 +40,19 @@ Description: Linux kernel debugging symbols for >>> @KR@ >>> all the necessary debug symbols for the kernel and its modules. >>> >>> Package: linux-kbuild-${KERNEL_NAME_PROVIDED} >>> +Build-Profiles: >>> Architecture: any >>> Depends: ${perl:Depends}, ${shlib:Depends} >>> 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-kbuild-${KERNEL_NAME_PROVIDED}-cross >>> +Build-Profiles: >>> +Architecture: any >>> +Depends: ${KERNEL_HEADERS_DEBIAN_DEPENDS}, ${perl:Depends}, >>> ${shlib:Depends} >>> +Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and >>> tools for @KR@ >>> + This package provides kernel kbuild scripts and tools >>> + as ${HOST_ARCH} cross binaries for @KR@ >>> + This is useful for those who need to cross build >>> + external modules using ISAR's sbuild-chroot-host >>> diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl >>> b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl >>> index 906dc580..7f293528 100644 >>> --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl >>> +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl >>> @@ -22,7 +22,17 @@ do_build() { >>> sed -i "s/@KR@/${KR}/g" ${S}/debian/control ${S}/debian/linux- >>> image- >>> ${KERNEL_NAME_PROVIDED}.* >>> >>> # Build the Linux kernel >>> - ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} >>> KCFLAGS="${KCFLAGS}" >>> KAFLAGS="${KAFLAGS}" >>> + if echo "${DEB_BUILD_PROFILES}" | grep -q -e "targetbuild" -e >>> "hostbuild"; then # Build kernel scripts and tools >>> + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} >>> 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 >>> + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} >>> KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" tools/objtool || true >>> + fi >>> + if grep -q "CONFIG_MODULES=y" ${KERNEL_BUILD_DIR}/.config; >>> then >>> + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} >>> KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" modules_prepare >>> + fi >>> + else # Build the Linux kernel >>> + ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} >>> KCFLAGS="${KCFLAGS}" >>> KAFLAGS="${KAFLAGS}" >>> + fi >>> >>> # Stop tracing >>> set +x >>> diff --git a/meta/recipes- >>> kernel/linux/files/debian/isar/common.tmpl >>> b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl >>> index f4c0519f..36e01691 100644 >>> --- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl >>> +++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl >>> @@ -11,6 +11,14 @@ KERNEL_PKG_KERN_HEADERS=linux-headers- >>> ${KERNEL_NAME_PROVIDED} >>> KERNEL_PKG_LIBC_HEADERS=linux-libc-dev >>> KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED} >>> >>> +if echo "${DEB_BUILD_PROFILES}" | grep -q "hostbuild"; then >>> + # Force creating kernel kbuild debian package with valid >>> host arch >>> + # Use a cross build to comply with arch specific kernel >>> defconfigs >>> + # The scripts and tools are always created for host arch >>> + eval $(dpkg-architecture -f -A ${DISTRO_ARCH}) >>> + CROSS_COMPILE=${DEB_TARGET_GNU_TYPE}- >>> +fi >>> + >>> # Constants >>> KCONF=.config >>> >>> diff --git a/meta/recipes- >>> kernel/linux/files/debian/isar/install.tmpl >>> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl >>> index 236b67c4..08b8a9a5 100644 >>> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl >>> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl >>> @@ -34,18 +34,24 @@ do_install() { >>> set -x >>> >>> # Run the install steps >>> - install_image >>> - if [ "${ARCH}" != "um" ]; then >>> - install_config >>> - install_map >>> + if ! echo "${DEB_BUILD_PROFILES}" | grep -q -e "targetbuild" - >>> e >>> "hostbuild"; then >>> + install_image >>> + if [ "${ARCH}" != "um" ]; then >>> + install_config >>> + install_map >>> + fi >>> + install_hooks >>> + install_dtbs >>> + install_kmods >>> + install_headers >>> fi >>> - install_hooks >>> - install_dtbs >>> - install_kmods >>> - install_headers >>> >>> - # Cleanup and install kernel scripts and tools >>> - rm -rf ${deb_kern_kbuild_dir} >>> + if ! echo "${DEB_BUILD_PROFILES}" | grep -q -e "targetbuild" - >>> e >>> "hostbuild" && echo "${DEB_BUILD_PROFILES}" | grep -q >>> "crosskbuild"; then >>> + # Install cross kernel scripts and tools >>> + install_kbuild ${deb_kern_kbuild_dir}-cross >>> + fi >>> + >>> + # Install kernel scripts and tools >>> install_kbuild ${deb_kern_kbuild_dir} >>> >>> # Stop tracing >>> diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl >>> b/meta/recipes-kernel/linux/files/debian/rules.tmpl >>> index e8ae3daa..1f838a41 100755 >>> --- a/meta/recipes-kernel/linux/files/debian/rules.tmpl >>> +++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl >>> @@ -48,4 +48,4 @@ override_dh_strip_nondeterminism: >>> true >>> >>> override_dh_strip: >>> - unset DEB_HOST_GNU_TYPE && dh_strip -Xvmlinu --no- >>> automatic-dbgsym >>> + dh_strip -Xvmlinu -Xlinux-kbuild-${KERNEL_NAME_PROVIDED}- >>> cross --no- >>> automatic-dbgsym >>> diff --git a/meta/recipes-kernel/linux/linux-custom.inc >>> b/meta/recipes- >>> kernel/linux/linux-custom.inc >>> index 94ed84a2..85faa2d7 100644 >>> --- a/meta/recipes-kernel/linux/linux-custom.inc >>> +++ b/meta/recipes-kernel/linux/linux-custom.inc >>> @@ -85,9 +85,6 @@ TEMPLATE_VARS += " \ >>> DISTRIBUTOR \ >>> " >>> >>> -inherit dpkg >>> -inherit template >>> - >>> # Add custom cflags to the kernel build >>> KCFLAGS ?= "-fdebug-prefix-map=${CURDIR}=." >>> KAFLAGS ?= "-fdebug-prefix-map=${CURDIR}=." >>> @@ -95,17 +92,57 @@ KAFLAGS ?= "-fdebug-prefix-map=${CURDIR}=." >>> # Derive name of the kernel packages from the name of this recipe >>> KERNEL_NAME_PROVIDED ?= "${@ d.getVar('PN').partition('linux- >>> ')[2]}" >>> >>> -# Make bitbake know we will be producing linux-image and linux- >>> headers >>> packages >>> python() { >>> kernel_name = d.getVar("KERNEL_NAME_PROVIDED") >>> - d.setVar('PROVIDES', 'linux-image-' + kernel_name + ' ' + \ >>> - 'linux-headers-' + kernel_name) >>> + distro_arch = d.getVar("DISTRO_ARCH") >>> + host_arch = d.getVar("HOST_ARCH") >>> headers_depends = "linux-kbuild-" + kernel_name >>> >>> + # The "-compat" and "-native" multiarch bitbake targets are >>> used to run >>> + # additional target or host specific builds for kbuild scripts >>> and >>> tools. >>> + # The "-compat" bitbake target requests a "target" build >>> + # and the "-native" bitbake target requests a "host" build. >>> + # >>> + # For different distro and host archs >>> + # - Add dependency for sbuild-chroot-target >>> + # to allow building arch specific kbuild scripts and tools >>> + # - Set correct variable overrides >>> + is_compat = "compat" in d.getVar("PN", True) >>> + is_native = "native" in d.getVar("PN", True) >> >> Just a minor thing: The intended/preferred interface for recipes are >> the >> "class-native" and "class-compat" overrides set in multiarch.bbclass. >> This is nice for bitbake (just set MY_VAR:class-native = "value"), >> but >> unfortunately not so easy to use from Python code. Still, I'd avoid >> looking at PN again in the recipes, and instead go for >> >> is_compat = "class-compat" in d.getVar("OVERRIDES").split(":") >> >>> + >>> + # Determine creation of a kbuild-cross or (standard) kbuild >>> package for >>> the host >>> + is_cross_profile = distro_arch != host_arch and >>> d.getVar("ISAR_CROSS_COMPILE", True) == "1" >>> + >>> + if is_cross_profile: >>> + headers_depends = headers_depends + "-cross | " + >>> headers_depends >>> + build_depends = "crossbuild-essential-" + distro_arch + " >>> [" + >>> host_arch + "], " >>> + d.appendVar("DEB_BUILD_PROFILES", " crosskbuild") >>> + d.prependVar("KBUILD_DEPENDS", build_depends) >>> + d.appendVarFlag("do_prepare_build", "depends", " sbuild- >>> chroot- >>> target:do_build") >>> + d.setVar("ISAR_ENABLE_COMPAT_ARCH", "1") >>> + d.setVar("COMPAT_DISTRO_ARCH", distro_arch) >> >> This feels hacky... it overrides the compat mechanism, resulting in a >> "*-compat" package that is not actually for the compat arch. > > Yes, it seems a bit hacky... > > I'm unsure if this special kernel specific approach to rebuild kbuild > tools/scripts, forcing non-cross QEMU build even if ISAR cross-build is > enabled, legimitates adding a new similar approach like the > compat/native mechanism within ISAR. > > Reusing the "-compat" bitbake target enables the build of > a target specific kbuild package at cross builds avoiding deeper > changes to ISAR. Forcing a QEMU non-cross build even if > ISAR_CROSS_COMPILE is enabled. This is the important part: Running a > separate QEMU non-cross build for kernel scripts/tools. This is needed > because the tools/scripts kernel build does not support creation for > target arch while cross building. This is the property we should change once we have the means to build for the native arch as well. > > Let me know if you have suggestions to archieve that without using the > compat mechanism and avoiding deeper changes to ISAR. Important is that > a second dpkg build runs separatly within target's schroot (using > forced non-cross QEMU) while main build runs cross in host's schroot. > Earlier patchsets of this series used a way without using the new > compat/native mechanism but made deeper changes to ISAR. We will need changes in Isar and possibly also in some downstream recipes, though I think can be caught by linux-custom-module.inc and its helpers. This should not be your blocker. So far: we build tools for the host, even when building the kernel for the target. What we need: we build tools for the target, and if some module recipe wants to have them for cross-building as well, it asks for -native. Does that make sense? Jan -- Siemens AG, Technology Linux Expert Center