public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Fix do_copy_boot_files error
@ 2024-01-31 14:44 Ilia Skochilov
  2024-02-09 12:21 ` Nicu Liviu Huhulea
  0 siblings, 1 reply; 4+ messages in thread
From: Ilia Skochilov @ 2024-01-31 14:44 UTC (permalink / raw)
  To: isar-users; +Cc: Ilia Skochilov

When building different distros with the same machine
(e.g., phyboard-mira-bullseye and phyboard-mira-bookworm) the following error
occurs:
do_copy_boot_files: The recipe isar-image-base is trying to install files
into a shared area when those files already exists.
It happens when some files have the same names (e.g., dtb files) for different
distros.

Signed-off-by: Ilia Skochilov <iskochilov@ilbers.de>
---
 RECIPE-API-CHANGELOG.md | 8 ++++++++
 meta/conf/bitbake.conf  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index bea1287..c9c1eae 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -566,3 +566,11 @@ supported, but a warning is issued when it is used. Future versions will drop
 When building a custom kernel module, the `KBuild` file might be located in
 a subdirectory. To support this use-case, set `MODULE_DIR=$(PWD)/subdir` in
 the module build recipe.
+
+### Change DEPLOY_DIR_IMAGE
+Change DEPLOY_DIR_IMAGE from ${DEPLOY_DIR}/images/${MACHINE} to
+${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}. When building different distros
+with the same machine the following error occurs:
+do_copy_boot_files: The recipe isar-image-base is trying to install files
+into a shared area when those files already exists. It happens when some
+files have the same names (e.g., dtb files) for different distros.
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 80dc01c..006ac14 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -56,7 +56,7 @@ WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
 GIT_DL_LINK_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}"
 DEPLOY_DIR_BOOTSTRAP = "${DEPLOY_DIR}/bootstrap"
 DEPLOY_DIR_SDKCHROOT = "${DEPLOY_DIR}/sdkchroot"
-DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}"
+DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}"
 DL_DIR ?= "${TOPDIR}/downloads"
 SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
 SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}"
-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix do_copy_boot_files error
  2024-01-31 14:44 [PATCH] Fix do_copy_boot_files error Ilia Skochilov
@ 2024-02-09 12:21 ` Nicu Liviu Huhulea
  2024-02-12  7:58   ` Anton Mikanovich
  0 siblings, 1 reply; 4+ messages in thread
From: Nicu Liviu Huhulea @ 2024-02-09 12:21 UTC (permalink / raw)
  To: isar-users


[-- Attachment #1.1: Type: text/plain, Size: 3379 bytes --]

Hello,

It seems that I get the same behavior, but with other steps: having 2 
images that uses the same dtbs for booting. First image will complete the 
build fine and the dtbs are in the deploydir.
The 2nd image does not complete the build because the dtbs are already in 
the deploydir.
This happens because of the introduction of the 
do_copy_boot_files_setscene() where this verification takes place. From my 
perspective a possible solution would be to copy those files
only if they don't exist.

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




On Wednesday, January 31, 2024 at 4:45:48 PM UTC+2 Ilia Skochilov wrote:

> When building different distros with the same machine
> (e.g., phyboard-mira-bullseye and phyboard-mira-bookworm) the following 
> error
> occurs:
> do_copy_boot_files: The recipe isar-image-base is trying to install files
> into a shared area when those files already exists.
> It happens when some files have the same names (e.g., dtb files) for 
> different
> distros.
>
> Signed-off-by: Ilia Skochilov <iskoc...@ilbers.de>
> ---
> RECIPE-API-CHANGELOG.md | 8 ++++++++
> meta/conf/bitbake.conf | 2 +-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index bea1287..c9c1eae 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -566,3 +566,11 @@ supported, but a warning is issued when it is used. 
> Future versions will drop
> When building a custom kernel module, the `KBuild` file might be located in
> a subdirectory. To support this use-case, set `MODULE_DIR=$(PWD)/subdir` in
> the module build recipe.
> +
> +### Change DEPLOY_DIR_IMAGE
> +Change DEPLOY_DIR_IMAGE from ${DEPLOY_DIR}/images/${MACHINE} to
> +${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}. When building different distros
> +with the same machine the following error occurs:
> +do_copy_boot_files: The recipe isar-image-base is trying to install files
> +into a shared area when those files already exists. It happens when some
> +files have the same names (e.g., dtb files) for different distros.
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 80dc01c..006ac14 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -56,7 +56,7 @@ WORKDIR = 
> "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}"
> GIT_DL_LINK_DIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}"
> DEPLOY_DIR_BOOTSTRAP = "${DEPLOY_DIR}/bootstrap"
> DEPLOY_DIR_SDKCHROOT = "${DEPLOY_DIR}/sdkchroot"
> -DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}"
> +DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}"
> DL_DIR ?= "${TOPDIR}/downloads"
> SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
> SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}"
> -- 
> 2.39.2
>
>

[-- Attachment #1.2: Type: text/html, Size: 3956 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix do_copy_boot_files error
  2024-02-09 12:21 ` Nicu Liviu Huhulea
@ 2024-02-12  7:58   ` Anton Mikanovich
  2024-02-12  9:20     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Mikanovich @ 2024-02-12  7:58 UTC (permalink / raw)
  To: Nicu Liviu Huhulea, isar-users, Ilia Skochilov

09/02/2024 14:21, Nicu Liviu Huhulea wrote:
> Hello,
>
> It seems that I get the same behavior, but with other steps: having 2 
> images that uses the same dtbs for booting. First image will complete 
> the build fine and the dtbs are in the deploydir.
> The 2nd image does not complete the build because the dtbs are already 
> in the deploydir.
> This happens because of the introduction of the 
> do_copy_boot_files_setscene() where this verification takes place. 
> From my perspective a possible solution would be to copy those files
> only if they don't exist.

Hello,
This approach will not work if two dtbs with the same name will have any 
changes.
Two different distro versions (with different kernel versions) may have 
different dtbs but with the same name.
That's why we need to separate them any in case.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix do_copy_boot_files error
  2024-02-12  7:58   ` Anton Mikanovich
@ 2024-02-12  9:20     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2024-02-12  9:20 UTC (permalink / raw)
  To: Anton Mikanovich, Nicu Liviu Huhulea, isar-users, Ilia Skochilov

On 12.02.24 08:58, Anton Mikanovich wrote:
> 09/02/2024 14:21, Nicu Liviu Huhulea wrote:
>> Hello,
>>
>> It seems that I get the same behavior, but with other steps: having 2
>> images that uses the same dtbs for booting. First image will complete
>> the build fine and the dtbs are in the deploydir.
>> The 2nd image does not complete the build because the dtbs are already
>> in the deploydir.
>> This happens because of the introduction of the
>> do_copy_boot_files_setscene() where this verification takes place.
>> From my perspective a possible solution would be to copy those files
>> only if they don't exist.
> 
> Hello,
> This approach will not work if two dtbs with the same name will have any
> changes.
> Two different distro versions (with different kernel versions) may have
> different dtbs but with the same name.
> That's why we need to separate them any in case.

Separation is not wrong but also does not solve the issue when
rebuilding into a dirty deploy dir with a different config for the same
machine/distro.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-12  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 14:44 [PATCH] Fix do_copy_boot_files error Ilia Skochilov
2024-02-09 12:21 ` Nicu Liviu Huhulea
2024-02-12  7:58   ` Anton Mikanovich
2024-02-12  9:20     ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox