From patchwork Wed Apr 29 15:38:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhihang Wei X-Patchwork-Id: 5059 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 29 Apr 2026 17:38:41 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f58.google.com (mail-wm1-f58.google.com [209.85.128.58]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 63TFceFS018757 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Apr 2026 17:38:40 +0200 Received: by mail-wm1-f58.google.com with SMTP id 5b1f17b1804b1-488d9e1e61asf109240015e9.0 for ; Wed, 29 Apr 2026 08:38:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777477114; cv=pass; d=google.com; s=arc-20240605; b=NlAnYiqtfA+INxJNQattlHOguOjNRlD3C7lhf6i/nro8VF/kEIridJg07+gbT8wGQF I5psZwIN+0UkBUePml9I7iNILUQgZEW8wZYlAxPacfAknjGYc0ujriKG2TRfnolQAM5w HLiUtEPf9ejEukEExM6ihgoRC9Zrfzp0FFSQS/8xTBXhTCz+I+Uow1hlmNLRVoqDyrXs uDzvh48AG9v0VnDKIdZN9XQkT8A5unqjGZXRxTzlrvyNwBkjyBP1f6kb7HSvrAb92TWd SDvjSl6qOyTQnBxnwKEJl9SvdGtkjn5JMjqTDc+sYIi0WEv89gHsBurB/c9wfAhZ+E0U DWXQ== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=XNJMjHI1yItocEtIM0HC1WGuaJdgWAjtPZ4pMlI0q4M=; fh=TLx3T4FdKgz/HU+iQ9U5ebWqD4D/nemzNNCtmovM50Y=; b=bTnen6Uf1LVDPKtdF4/mVOPdEGLvYRlWnDUniTQH4lm6XKyVbUOWzusZsV7orvnY61 sFU2ZSuY2hzsfAwgIiVUmeAPuukmTbktEUqyfPMGrAje5qpIRlcPQAJysXop64UH88MZ UX5FVhAehp/M3MpQAWEX/3ycUkLi737UAW+kF4V0e1bSxKULQLlEw7+lKC9ldsGoe63w Boc4dNue13ynP3r9WxdZdZXM2QekNNNjCQ0rXnJyGv+KluyRmf+BRnuroQMVrbtvAH0C 7q/+odRr5t8G2tdXZ1MuUFZGk/bMn6/ZYzetwCp/u6O1Ln/Uz3M13mFEh0n4XHsDLe8O vpcQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1777477114; x=1778081914; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=XNJMjHI1yItocEtIM0HC1WGuaJdgWAjtPZ4pMlI0q4M=; b=SRJ9nYC3odGOKdjL2ehlifT6MFeYzkL5reQ7dbHDfl5rB3W4eVoyhApzcXxFE8tMhC KOhlYrswp8pkb7TU7BhJBUXj1dssdmTsWHNifomN5DzSx81a4oOKJmj56Bu4ystcUr53 LKvMXb0WTY4UOngl2iaFiiEMbRBlA9dyP2fzGA//NaGVb3l1FZ5Bte/DwaNgPn2XpfLo vsBxt3N8Lhkk5AmVhI9vpHxFhVYFlTQazqpVEe1+tfbGPAkRGMKYZIFUcRFyTrL3kBCj 3w8hfHxVlUpJwuBBQAmdetTTd2JtWbfI5htejDHiv2xKidU+c/PMC9pooGofHnOWIpj0 chnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777477114; x=1778081914; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :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:sender:from:to:cc:subject:date :message-id:reply-to; bh=XNJMjHI1yItocEtIM0HC1WGuaJdgWAjtPZ4pMlI0q4M=; b=SOLCfw+JwP1iOPDTY4FxiqXpq7QemcTU6zGvXd2gmQgZn5qtTDI2sauxl9+mv8DssW cODPqqIbJssqtPjmWU4/1SflvRC0G3GzJViGch3N/F5yh+NMgUvZje04zgww+pr256Kj lo/hXQDSy9a1TxJ10VCrpdIERG5uxCqhjnR3zHx+dq6i5ZhBEkgGYTY1qa0Pj1ohX/1f aHfH05UuMKIjq3sUtNC0Gx+uqnxX6k9dbU5fWNo8SQxjNQaSb6y5TC5b/gZgILsvcURX fr7bMYiD64+UlEu+Y1pRqx+Gdosfq0DcgtofUNAruA3rL2f+pnaZqtEviHNeTqy8A5hT rlHQ== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AFNElJ81dFZkA3B3bwdrOhXj/xlmysBvqLH+F7ee5b3AkUEYYZBuOLKKE6jY4i3rqO1J00T0WPeaabs=@isar-build.org X-Gm-Message-State: AOJu0YwYUeeL/xl74bamZ6zmMnkiGcRhWtykmaFzPFG62GOPoHcKIYYJ EujU/Tcyo46rtBNhZvKrdsFZCaqzwro+/EpF94/4MrXK85yn0Sz7Z2uz X-Received: by 2002:a05:600c:3411:b0:489:1ff5:edda with SMTP id 5b1f17b1804b1-48a7b83efe0mr41597085e9.6.1777477113910; Wed, 29 Apr 2026 08:38:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="AUV6zMOkgRxEwyK+956+FxNOvZdkZSGBTIKKYYdh+k+XIGmL6Q==" Received: by 2002:a05:6000:2982:20b0:43e:aa64:9a2b with SMTP id ffacd0b85a97d-43eb1c71e0els7125941f8f.2.-pod-prod-09-eu; Wed, 29 Apr 2026 08:38:31 -0700 (PDT) X-Received: by 2002:a05:6000:2c03:b0:441:360a:9438 with SMTP id ffacd0b85a97d-44790473b3fmr7538126f8f.25.1777477111461; Wed, 29 Apr 2026 08:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777477111; cv=none; d=google.com; s=arc-20240605; b=YcIM6DFVEodxVoKGvq1Uf8ECXHj1SC8yWlb5dRime8oJ61mGnnJKEFATjztCD3DpHC 0WtxEt5VDXvBKKfLQGlB6hXIR3Ht/U4Nfodb+vqP6Xg3ihVzIWzJLQtp+OBsAc89Ey9i TyKXZcEeiwBUaCmrTriNDmsGCaRKmEIk/D42PXepNuvzhIRd/KEa6BTnNY1NTBe+39dZ 0v8zRW2zAtPZ9SjtjJMDfxB4JbO1QjAT8g/ilkkU7/bKpxH6SSZs27V6P6sxDikqqDzb a1Wzxw1vz7lCPVGeXypPfzIjhGN9VDVlYGOfmdvFFgwZ/BHOQkUZtkvDlkv3GMYkpEYz hpPg== 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; bh=S6Gi/Tj5FoeXI8wVfrFo+QyE7jjE1so2V+V3KAfiy8M=; fh=SviDX/E5C+CNuLG4aYddj0ECCwgb1wEYINL+8UO5M6M=; b=M6G6d52fsFnaNX8oh8XvYLxP8zInMh65aCQ3pIyCE1UZzDCKoYHYvKH1OY7vmlvlFe HEDu4qHl3lui0j579qIkhOyxf6cLarLCX6WRd5wFMTMPoDrPGmyG+/Yyx42fNCgO2ACo Ye5LP20L+/UTFI9YvdV9iaP31JrMPGLklJXF3Pshwn5I/4YYKVjc5HWEHQ2PYSeM0os9 /OWNbosMbO16SCp03+K62w6CSzS7uGhxI3ewkVEoh2meB0220Otx1ZufX20/CBklEZWt gpZAWNSp4OFyoVXx5MEabHjL7ElKYa/yuj5MEL+WF6SatFpPZakPdPLeb8io11iFvwb7 xXWw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-447b5ee6894si42860f8f.5.2026.04.29.08.38.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Apr 2026 08:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from debian-zwei.m.ilbers.de ([88.130.203.42]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPA id 63TFcUGd018721; Wed, 29 Apr 2026 17:38:30 +0200 From: Zhihang Wei To: isar-users@googlegroups.com Cc: amikan@ilbers.de Subject: [PATCH v10 2/2] meta: Move kernel artifacts deployment from image recipe Date: Wed, 29 Apr 2026 17:38:29 +0200 Message-Id: <20260429153829.2668049-3-wzh@ilbers.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260429153829.2668049-1-wzh@ilbers.de> References: <20260429153829.2668049-1-wzh@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, 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-Original-Sender: wzh@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de 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: =?utf-8?q?INBOX?= From: Anton Mikanovich Task do_copy_boot_files deploys DTB files into the same location for different images (e.g., isar-image-base and isar-image-ci). This causes a build error. do_copy_boot_files is called once for every image recipe while dtb files belong to the kernel which is the same for both images. Performing dtb deployment once for the same kernel solves the issue. Introduce `kernel-deploy` recipe responsible for extracting the DTBs and kernel from the linux-image package and deploying them. The kernel package is now installed into sbuild chroot. This is achieved via the respective dependency of `kernel-deploy` recipe. Fixes test_dtb_deploy_images testcase: ERROR: mc:phyboard-mira-bookworm:isar-image-base-1.0-r0 do_copy_boot_files: The recipe isar-image-base is trying to install files into a shared area when those files already exist. Those files and their manifest location are: build/tmp/deploy/images/phyboard-mira/imx6q-phytec-mira-rdk-nand.dtb (not matched to any task) Please verify which recipe should provide the above files. Signed-off-by: Anton Mikanovich --- RECIPE-API-CHANGELOG.md | 12 +++++ meta/classes-recipe/image.bbclass | 39 +++++--------- .../kernel-deploy/kernel-deploy.bb | 53 +++++++++++++++++++ 3 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 meta/recipes-kernel/kernel-deploy/kernel-deploy.bb diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index 5723c4c3..2cecd03b 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -1082,3 +1082,15 @@ To prevent this new path is separated also by distro and kernel values. This change will influence on build artifacts location and should be taken into account by downstreams. + +### Move kernel and DTBs deployment from image recipe to kernel related one + +To prevent parallel conflicting artifacts deployment from the same kernel +used by different images, move do_copy_boot_files() task logic from the image +recipe to the separate one, which is once-per-kernel. With this aproach the +deployment of any kernel artifacts will be performed only once per kernel. + +To left previous kernel image path per-image symlinks are now used. + +This deployment is implemented as separated recipe to be compatible both with +custom and distro kernel types. diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 26a4ec06..a86ee443 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -1,5 +1,7 @@ # This software is a part of Isar. -# Copyright (C) 2015-2017 ilbers GmbH +# Copyright (C) 2015-2026 ilbers GmbH +# +# SPDX-License-Identifier: MIT # Make workdir and stamps machine-specific without changing common PN target WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}" @@ -9,7 +11,6 @@ STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*" # Sstate also needs to be machine-specific SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}" -SSTATETASKS += "do_copy_boot_files" IMAGE_INSTALL ?= "" IMAGE_FSTYPES ?= "ext4" @@ -381,37 +382,21 @@ INITRD_IMG = "${PP_DEPLOY}/${INITRD_DEPLOY_FILE}" # only one dtb file supported, pick the first DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}" -do_copy_boot_files[cleandirs] += "${DEPLOYDIR}" -do_copy_boot_files[sstate-inputdirs] = "${DEPLOYDIR}" -do_copy_boot_files[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" -do_copy_boot_files[network] = "${TASK_USE_SUDO}" +python() { + if d.getVar('DTB_FILES'): + d.appendVarFlag("do_copy_boot_files", "depends", "kernel-deploy-${KERNEL_NAME}:do_deploy") +} + +# Associate kernel with image by symlinks +do_copy_boot_files[dirs] += "${DEPLOY_DIR_IMAGE}" do_copy_boot_files() { - kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])" - if [ ! -f "$kernel" ]; then - kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])" - fi + kernel="$(realpath -q '${DEPLOY_DIR_IMAGE}/${KERNEL_NAME}'-vmlinu[xz]*)" if [ -f "$kernel" ]; then - sudo cat "$kernel" > "${DEPLOYDIR}/${KERNEL_IMAGE}" + ln -sfr "$kernel" "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}" fi - - for file in ${DTB_FILES}; do - dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ - -iwholename '*linux-image-*/'${file} | head -1)" - - if [ -z "$dtb" -o ! -e "$dtb" ]; then - die "${file} not found" - fi - - cp -f "$dtb" "${DEPLOYDIR}/" - done } addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install -python do_copy_boot_files_setscene () { - sstate_setscene(d) -} -addtask do_copy_boot_files_setscene - python do_image_tools() { """Virtual task""" pass diff --git a/meta/recipes-kernel/kernel-deploy/kernel-deploy.bb b/meta/recipes-kernel/kernel-deploy/kernel-deploy.bb new file mode 100644 index 00000000..32521148 --- /dev/null +++ b/meta/recipes-kernel/kernel-deploy/kernel-deploy.bb @@ -0,0 +1,53 @@ +# This software is a part of Isar. +# Copyright (C) ilbers GmbH, 2026 +# +# SPDX-License-Identifier: MIT + +inherit dpkg-raw + +MAINTAINER = "isar-users " + +PN:append = "-${KERNEL_NAME}" + +KERNEL_IMAGE_PKG ??= "${@ ("linux-image-" + d.getVar("KERNEL_NAME")) if d.getVar("KERNEL_NAME") else ""}" + +DEPENDS = "${KERNEL_IMAGE_PKG}" +DEBIAN_BUILD_DEPENDS = "${KERNEL_IMAGE_PKG}" + +DPKG_ARCH = "${PACKAGE_ARCH}" + +do_prepare_build:append() { + dir=debian/${PN}/boot + cat <> ${S}/debian/rules + mkdir -p ${dir} + realpath -q /boot/vmlinu[xz] + kernel="\$\$(realpath -q /vmlinu[xz])" && \ + if [ ! -f "\$\${kernel}" ]; then kernel="\$\$(realpath -q /boot/vmlinu[xz])"; fi && \ + if [ -f "\$\${kernel}" ]; then cp "\$\${kernel}" "${dir}/${KERNEL_NAME}-\$\$(basename \$\${kernel})"; fi +EOF + + for dtb in ${DTB_FILES}; do + dir=debian/${PN}/usr/lib/${PN}/$(dirname ${dtb}) + cat <> ${S}/debian/rules + mkdir -p ${dir} + find /usr/lib/linux-image* -path "*${dtb}" -print -exec cp {} ${dir} \; +EOF + done +} + +DTB_PACKAGE ??= "${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb" + +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" +do_deploy[cleandirs] = "${WORKDIR}/deploy" +do_deploy() { + dpkg --fsys-tarfile ${WORKDIR}/${DTB_PACKAGE} | \ + tar --wildcards --extract --directory ${WORKDIR}/deploy ./boot ./usr/lib/${PN} + find ${WORKDIR}/deploy/boot -path "*vmlinu*" -print \ + -exec cp {} ${DEPLOY_DIR_IMAGE}/ \; + for dtb in ${DTB_FILES}; do + mkdir -p ${DEPLOY_DIR_IMAGE}/$(dirname ${dtb}) + find ${WORKDIR}/deploy/usr/lib/${PN} -path "*${dtb}" -print \ + -exec cp {} ${DEPLOY_DIR_IMAGE}/${dtb} \; + done +} +addtask deploy before do_deploy_deb after do_dpkg_build