* [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already
@ 2024-02-09 14:17 nicusor.huhulea
2024-02-11 12:58 ` Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: nicusor.huhulea @ 2024-02-09 14:17 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 299 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 966 bytes --]
[-- Attachment #2: 0001-classes-images.bbclass-don-t-copy-the-dtbs-if-they-e.patch --]
[-- Type: application/octet-stream, Size: 1530 bytes --]
From 639ce9ecfb2d323a1798533884a53151bd74b202 Mon Sep 17 00:00:00 2001
From: Nicusor Huhulea <nicusor.huhulea@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.huhulea@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
done
}
addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already
2024-02-09 14:17 [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already nicusor.huhulea
@ 2024-02-11 12:58 ` Jan Kiszka
2024-02-12 9:36 ` nicusor.huhulea
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2024-02-11 12:58 UTC (permalink / raw)
To: nicusor.huhulea, isar-users
On 09.02.24 15:17, 'nicusor.huhulea@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.huhulea@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.huhulea@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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already
2024-02-11 12:58 ` Jan Kiszka
@ 2024-02-12 9:36 ` nicusor.huhulea
0 siblings, 0 replies; 3+ messages in thread
From: nicusor.huhulea @ 2024-02-12 9:36 UTC (permalink / raw)
To: Kiszka, Jan, isar-users
________________________________________
From: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>
Sent: Sunday, February 11, 2024 2:58 PM
To: Huhulea, Nicusor Liviu (DI CTO FDS CES LX SVCS); isar-users@googlegroups.com
Subject: Re: [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already
On 09.02.24 15:17, 'nicusor.huhulea@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.
> From 639ce9ecfb2d323a1798533884a53151bd74b202 Mon Sep 17 00:00:00 2001
> From: Nicusor Huhulea <nicusor.huhulea@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.huhulea@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
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
> done
> }
> addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
> --
> 2.39.2
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-12 9:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 14:17 [PATCH] classes/images.bbclass: don't copy the dtbs if they exist already nicusor.huhulea
2024-02-11 12:58 ` Jan Kiszka
2024-02-12 9:36 ` nicusor.huhulea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox