diff mbox series

[meta-ti,v2] ti-img-rogue-umlibs: harden handling of usrmerge

Message ID 20230906150551.2362062-1-max.oss.09@gmail.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,v2] ti-img-rogue-umlibs: harden handling of usrmerge | expand

Commit Message

Max Krummenacher Sept. 6, 2023, 3:05 p.m. UTC
From: Max Krummenacher <max.krummenacher@toradex.com>

Only move directories which haven't already been moved.
This prevents a build error should a subsequent bitbake execution
rerun do_install where the sources to 'mv' no longer exist.
| mv: cannot stat 'ti-img-rogue-umlibs/23.1.6404501/git/targetfs/am62_linux/lws-generic/release/lib/firmware': No such file or directory

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 .../powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ryan Eatmon Sept. 29, 2023, 3:54 p.m. UTC | #1
On 9/6/2023 10:05 AM, Max Krummenacher wrote:
> From: Max Krummenacher <max.krummenacher@toradex.com>
> 
> Only move directories which haven't already been moved.
> This prevents a build error should a subsequent bitbake execution
> rerun do_install where the sources to 'mv' no longer exist.
> | mv: cannot stat 'ti-img-rogue-umlibs/23.1.6404501/git/targetfs/am62_linux/lws-generic/release/lib/firmware': No such file or directory
> 
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>   .../powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb        | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> index 9b45a91f..2cf13c60 100644
> --- a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> +++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> @@ -68,7 +68,9 @@ do_install:prepend() {
>           done
>       fi
>       if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then
> -        mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
> +        if [ -e ${S}/lib/firmware ]; then
> +            mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
> +        fi

Sorry it has taken so long to get back to this.  Busy times over here.

I think the better plan is to not move the directory, but use some other 
command to copy the files.  That way there should be no need to put a 
guard around the command.  I'll work the Randoplh to get this updated 
the correct way.

Thank you for pointing out the issue.


>       fi
>   
>       # clean up any empty directories
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16922): https://lists.yoctoproject.org/g/meta-ti/message/16922
> Mute This Topic: https://lists.yoctoproject.org/mt/101194647/6551054
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [reatmon@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ryan Eatmon Sept. 29, 2023, 4:15 p.m. UTC | #2
On 9/29/2023 10:54 AM, Ryan Eatmon via lists.yoctoproject.org wrote:
> 
> 
> On 9/6/2023 10:05 AM, Max Krummenacher wrote:
>> From: Max Krummenacher <max.krummenacher@toradex.com>
>>
>> Only move directories which haven't already been moved.
>> This prevents a build error should a subsequent bitbake execution
>> rerun do_install where the sources to 'mv' no longer exist.
>> | mv: cannot stat 
>> 'ti-img-rogue-umlibs/23.1.6404501/git/targetfs/am62_linux/lws-generic/release/lib/firmware': No such file or directory
>>
>> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
>> ---
>>   .../powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb        | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git 
>> a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
>> index 9b45a91f..2cf13c60 100644
>> --- 
>> a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
>> +++ 
>> b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
>> @@ -68,7 +68,9 @@ do_install:prepend() {
>>           done
>>       fi
>>       if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 
>> 'false', d)}; then
>> -        mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
>> +        if [ -e ${S}/lib/firmware ]; then
>> +            mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
>> +        fi
> 
> Sorry it has taken so long to get back to this.  Busy times over here.
> 
> I think the better plan is to not move the directory, but use some other 
> command to copy the files.  That way there should be no need to put a 
> guard around the command.  I'll work the Randoplh to get this updated 
> the correct way.
> 
> Thank you for pointing out the issue.

Spoke with Randolph and he agrees with you that this patch is good 
enough.  I will apply it and test now.



> 
> 
>>       fi
>>       # clean up any empty directories
>>
>>
>>
>>
>>
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#17036): https://lists.yoctoproject.org/g/meta-ti/message/17036
> Mute This Topic: https://lists.yoctoproject.org/mt/101194647/6551054
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/leave/10828724/6551054/1815494134/xyzzy [reatmon@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Max Krummenacher Sept. 30, 2023, 8:44 a.m. UTC | #3
Hi Ryan

Am Freitag, dem 29.09.2023 um 11:15 -0500 schrieb Ryan Eatmon:
> 
> On 9/29/2023 10:54 AM, Ryan Eatmon via lists.yoctoproject.org wrote:
> > 
> > 
> > On 9/6/2023 10:05 AM, Max Krummenacher wrote:
> > > From: Max Krummenacher <max.krummenacher@toradex.com>
> > > 
> > > Only move directories which haven't already been moved.
> > > This prevents a build error should a subsequent bitbake execution
> > > rerun do_install where the sources to 'mv' no longer exist.
> > > > mv: cannot stat 
> > > 'ti-img-rogue-umlibs/23.1.6404501/git/targetfs/am62_linux/lws-generic/release/lib/firmware': No such file or directory
> > > 
> > > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > > ---
> > >   .../powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb        | 4 +++-
> > >   1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git 
> > > a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> > > index 9b45a91f..2cf13c60 100644
> > > --- 
> > > a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> > > +++ 
> > > b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
> > > @@ -68,7 +68,9 @@ do_install:prepend() {
> > >           done
> > >       fi
> > >       if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 
> > > 'false', d)}; then
> > > -        mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
> > > +        if [ -e ${S}/lib/firmware ]; then
> > > +            mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
> > > +        fi
> > 
> > Sorry it has taken so long to get back to this.  Busy times over here.
> > 
> > I think the better plan is to not move the directory, but use some other 
> > command to copy the files.  That way there should be no need to put a 
> > guard around the command.  I'll work the Randoplh to get this updated 
> > the correct way.
> > 
> > Thank you for pointing out the issue.
> 
> Spoke with Randolph and he agrees with you that this patch is good 
> enough.  I will apply it and test now.

When I did it I checked if mv has an option to not fail if the source
does not exist and didn't find any.
I guess it is anyway a real corner case to be able to hit the issue.
Thanks for pulling it in.

Regards
Max
> 
> 
> 
> > 
> > 
> > >       fi
> > >       # clean up any empty directories
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#17036): https://lists.yoctoproject.org/g/meta-ti/message/17036
> > Mute This Topic: https://lists.yoctoproject.org/mt/101194647/6551054
> > Group Owner: meta-ti+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/leave/10828724/6551054/1815494134/xyzzy [reatmon@ti.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> > 
>
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
index 9b45a91f..2cf13c60 100644
--- a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
+++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb
@@ -68,7 +68,9 @@  do_install:prepend() {
         done
     fi
     if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then
-        mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
+        if [ -e ${S}/lib/firmware ]; then
+            mv ${S}/lib/firmware ${S}${nonarch_base_libdir}
+        fi
     fi
 
     # clean up any empty directories