From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7330273720441765888 X-Received: by 2002:a05:6870:d8cc:b0:219:840f:d7d with SMTP id of12-20020a056870d8cc00b00219840f0d7dmr2037633oac.17.1707574567954; Sat, 10 Feb 2024 06:16:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:1c43:b0:68c:be07:46f5 with SMTP id if3-20020a0562141c4300b0068cbe0746f5ls3188619qvb.1.-pod-prod-09-us; Sat, 10 Feb 2024 06:16:07 -0800 (PST) X-Received: by 2002:ad4:5045:0:b0:68c:e329:b124 with SMTP id m5-20020ad45045000000b0068ce329b124mr127303qvq.12.1707574567285; Sat, 10 Feb 2024 06:16:07 -0800 (PST) Received: by 2002:a05:620a:1a26:b0:785:9565:e76e with SMTP id af79cd13be357-785a51f45c6ms85a; Fri, 9 Feb 2024 04:21:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGGyS8P3DcgvRVosipjShHCy4NOvxIGo0xzAFkKe04vRINztEJxfoInbCkF8oJvJkZm10O1Yh3YA== X-Received: by 2002:a05:6214:e64:b0:68c:80f6:71ed with SMTP id jz4-20020a0562140e6400b0068c80f671edmr30534qvb.5.1707481311066; Fri, 09 Feb 2024 04:21:51 -0800 (PST) X-Google-Thread-Subscription: Yes X-Google-Web-Client: true Date: Fri, 9 Feb 2024 04:21:50 -0800 (PST) From: Nicu Liviu Huhulea To: isar-users Message-Id: <5feb979d-5ec2-4801-8966-7df0c44a0278n@googlegroups.com> In-Reply-To: <20240131144459.2386220-1-iskochilov@ilbers.de> References: <20240131144459.2386220-1-iskochilov@ilbers.de> Subject: Re: [PATCH] Fix do_copy_boot_files error MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_58430_2034386669.1707481310729" X-TUID: 4COAy3GPs7b1 ------=_Part_58430_2034386669.1707481310729 Content-Type: multipart/alternative; boundary="----=_Part_58431_902771588.1707481310729" ------=_Part_58431_902771588.1707481310729 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, It seems that I get the same behavior, but with other steps: having 2=20 images that uses the same dtbs for booting. First image will complete the= =20 build fine and the dtbs are in the deploydir. The 2nd image does not complete the build because the dtbs are already in= =20 the deploydir. This happens because of the introduction of the=20 do_copy_boot_files_setscene() where this verification takes place. From my= =20 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 =20 - cp -f "$dtb" "${DEPLOYDIR}/" + dtb_name=3D$(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=20 do_rootfs_install On Wednesday, January 31, 2024 at 4:45:48=E2=80=AFPM UTC+2 Ilia Skochilov w= rote: > When building different distros with the same machine > (e.g., phyboard-mira-bullseye and phyboard-mira-bookworm) the following= =20 > 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=20 > different > distros. > > Signed-off-by: Ilia Skochilov > --- > 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.= =20 > 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=3D$(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 distr= os > +with the same machine the following error occurs: > +do_copy_boot_files: The recipe isar-image-base is trying to install file= s > +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 =3D=20 > "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}/${PV}-${PR}" > GIT_DL_LINK_DIR =3D "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}" > DEPLOY_DIR_BOOTSTRAP =3D "${DEPLOY_DIR}/bootstrap" > DEPLOY_DIR_SDKCHROOT =3D "${DEPLOY_DIR}/sdkchroot" > -DEPLOY_DIR_IMAGE =3D "${DEPLOY_DIR}/images/${MACHINE}" > +DEPLOY_DIR_IMAGE =3D "${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}" > DL_DIR ?=3D "${TOPDIR}/downloads" > SSTATE_DIR ?=3D "${TOPDIR}/sstate-cache" > SSTATE_MANIFESTS =3D "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}" > --=20 > 2.39.2 > > ------=_Part_58431_902771588.1707481310729 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello,

It seems that I get the same behavior, but with other ste= ps: having 2 images that uses the same dtbs for booting. First image will c= omplete the build fine and the dtbs are in the deploydir.
The 2nd imag= e 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_s= etscene() where this verification takes place. From my perspective a possib= le solution would be to copy those files
only if they don't exist.

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclas= s
index d9fc04eb..070a14dd 100644
--- a/meta/classes/image.bbclas= s
+++ b/meta/classes/image.bbclass
@@ -393,7 +393,10 @@ do_copy_b= oot_files() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0die "${f= ile} not found"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fi
=C2=A0
= - =C2=A0 =C2=A0 =C2=A0 =C2=A0cp -f "$dtb" "${DEPLOYDIR}/"
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0dtb_name=3D$(basename "${file}")
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0if [ ! -f "${DEPLOY_DIR_IMAGE}/${dtb_name}" ]; then
+ =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp -f "$dtb" "${DEPLOYDIR}/"
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0fi
=C2=A0 =C2=A0 =C2=A0done
=C2=A0}
= =C2=A0addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_= install




On Wednesday, January 31, 2024 at 4:45:48=E2=80= =AFPM 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 fil= es
into a shared area when those files already exists.
It happens when some files have the same names (e.g., dtb files) for di= fferent
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 locat= ed in
a subdirectory. To support this use-case, set `MODULE_DIR=3D$(PWD)/sub= dir` 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 dis= tros
+with the same machine the following error occurs:
+do_copy_boot_files: The recipe isar-image-base is trying to install fi= les
+into a shared area when those files already exists. It happens when so= me
+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 =3D "${TMPDIR}/work/${DISTRO}-${DISTRO_A= RCH}/${PN}/${PV}-${PR}"
GIT_DL_LINK_DIR =3D "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}"= ;
DEPLOY_DIR_BOOTSTRAP =3D "${DEPLOY_DIR}/bootstrap"
DEPLOY_DIR_SDKCHROOT =3D "${DEPLOY_DIR}/sdkchroot"
-DEPLOY_DIR_IMAGE =3D "${DEPLOY_DIR}/images/${MACHINE}"
+DEPLOY_DIR_IMAGE =3D "${DEPLOY_DIR}/images/${MACHINE}-${DISTRO}&q= uot;
DL_DIR ?=3D "${TOPDIR}/downloads"
SSTATE_DIR ?=3D "${TOPDIR}/sstate-cache"
SSTATE_MANIFESTS =3D "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO= _ARCH}"
--=20
2.39.2

------=_Part_58431_902771588.1707481310729-- ------=_Part_58430_2034386669.1707481310729--