[PATCH] classes/images.bbclass: don't copy the dtbs if they exist already

26 views
Skip to first unread message

nicusor...@siemens.com

unread,
Feb 10, 2024, 9:16:07 AM2/10/24
to isar-...@googlegroups.com
This usually reproduces when more than one image is being build and it uses the same files for boot e.g dtb
I can reproduce this using the upstream meta-iot2050(https://github.com/siemens/meta-iot2050) when trying 
to build iot2050-image-example followed by a build on a iot2050-image-swu-example
0001-classes-images.bbclass-don-t-copy-the-dtbs-if-they-e.patch

Jan Kiszka

unread,
Feb 11, 2024, 7:58:41 AM2/11/24
to nicusor...@siemens.com, isar-...@googlegroups.com
On 09.02.24 15:17, 'nicusor...@siemens.com' via isar-users wrote:
> This usually reproduces when more than one image is being build and it
> uses the same files for boot e.g dtb
> I can reproduce this using the upstream
> meta-iot2050(https://github.com/siemens/meta-iot2050
> <https://github.com/siemens/meta-iot2050>) when trying 
> to build iot2050-image-example followed by a build on a
> iot2050-image-swu-example
>

Please send patches inline. And send plaintext emails, not HTML.

> From 639ce9ecfb2d323a1798533884a53151bd74b202 Mon Sep 17 00:00:00 2001
> From: Nicusor Huhulea <nicusor...@siemens.com>
> Date: Fri, 9 Feb 2024 10:44:26 +0200
> Subject: [PATCH] classes/images.bbclass: don't copy the dtbs if they exist
> already
>
> * with the introduction of do_copy_boot_files_setscene having the same
> file in the same location does not seems possible anymore, so copy those
> files only if they don't exist.
> * ERROR: development-image-1.0-r21 do_copy_boot_files_setscene: The recipe development-image is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
> /home/nhuhulea/indOs/next/build-ipc-edition/tmp/deploy/images/iot2050/k3-am6548-iot2050-advanced-sm.dtb
> (matched in manifest-arm64-service-stick-image.copy_boot_files)
>
> Signed-off-by: Nicusor Huhulea <nicusor...@siemens.com>
> ---
> meta/classes/image.bbclass | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index d9fc04eb..070a14dd 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -393,7 +393,10 @@ do_copy_boot_files() {
> die "${file} not found"
> fi
>
> - cp -f "$dtb" "${DEPLOYDIR}/"
> + dtb_name=$(basename "${file}")
> + if [ ! -f "${DEPLOY_DIR_IMAGE}/${dtb_name}" ]; then
> + cp -f "$dtb" "${DEPLOYDIR}/"
> + fi

What if the two files are actually different, eg. after updating the
kernel recipe and rebuilding things? And what about the other things we
deploy here?

Jan

> done
> }
> addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
> --
> 2.39.2

--
Siemens AG, Technology
Linux Expert Center

nicusor...@siemens.com

unread,
Feb 12, 2024, 4:36:24 AM2/12/24
to Kiszka, Jan, isar-...@googlegroups.com


________________________________________
From: Kiszka, Jan (T CED) <jan.k...@siemens.com>
Sent: Sunday, February 11, 2024 2:58 PM
To: Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS); isar-...@googlegroups.com
Subject: Re: [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already

On 09.02.24 15:17, 'nicusor...@siemens.com' via isar-users wrote:
> This usually reproduces when more than one image is being build and it
> uses the same files for boot e.g dtb
> I can reproduce this using the upstream
> meta-iot2050(https://github.com/siemens/meta-iot2050
> <https://github.com/siemens/meta-iot2050>) when trying
> to build iot2050-image-example followed by a build on a
> iot2050-image-swu-example
>

Please send patches inline. And send plaintext emails, not HTML.
Sorry about this.
I see the use case and I agree that this doesn't seem to be a valid solution.

I have analyzed on my side a few possible ways to have a much better solution:
1. Renaming the other dtbs to avoid conflicts and doesn't seem to be the right approach
2. modify one of the recipe to use a different deploy directory e.g: "${TMPDIR}/deploy-recipeA/"
3. instead of installing to "${DEPLOY_DIR}", recipeA should install to "${DEPLOY_DIR}/recipeA"
4. creating separate directories within the deploy directory for each package
right now all the things goes to a 'deploy' folder, I would see this something like
e.g: DEPLOYDIR_image_A = "${DEPLOYDIR}"/deploy-image_A"
DEPLOYDIR_image_B = "${DEPLOYDIR}"/deploy-image_B"

items 1,2 and 3 seem to require intervention from an isar user. I need to modify the other recipe.
item 4 seem to require changes to the isar layer.

Nicu
Reply all
Reply to author
Forward
0 new messages