public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf
@ 2024-08-30  6:13 srinuvasan.a via isar-users
  2024-08-30  6:29 ` 'Jan Kiszka' via isar-users
  2024-09-06  5:58 ` Uladzimir Bely
  0 siblings, 2 replies; 5+ messages in thread
From: srinuvasan.a via isar-users @ 2024-08-30  6:13 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan.a@siemens.com>

With the present implementation find statemnt return the regular
executable files under bin,sbin and usr/lib/gcc* which contains the
script files as well.

Actually we are tuning interp and rpath only for ELF executable, hence
added additional condition in the find statement to return only ELF
executable.

With this change we are avoiding unncessarily checking the interpreter
for non ELF executable files.

Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
 meta/recipes-devtools/sdk-files/files/relocate-sdk.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
index 82f63b30..e02e71f4 100755
--- a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
+++ b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
@@ -27,7 +27,7 @@ fi
 
 echo -n "Adjusting path of SDK to '${new_sdkroot}'... "
 
-for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/gcc* -executable -type f); do
+for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/gcc* -executable -type f -exec file {} \; | grep ELF | awk -F ':' '{ print $1 }'); do
 	interpreter=$(patchelf --print-interpreter ${binary} 2>/dev/null)
 	oldpath=${interpreter%/lib*/ld-linux*}
 	interpreter=${interpreter#${oldpath}}
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240830061353.841518-1-srinuvasan.a%40siemens.com.

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

* Re: [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf
  2024-08-30  6:13 [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf srinuvasan.a via isar-users
@ 2024-08-30  6:29 ` 'Jan Kiszka' via isar-users
  2024-08-30  6:38   ` Srinuvasan Arjunan
  2024-09-06  5:58 ` Uladzimir Bely
  1 sibling, 1 reply; 5+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-08-30  6:29 UTC (permalink / raw)
  To: srinuvasan.a, isar-users

On 30.08.24 08:13, srinuvasan.a@siemens.com wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
> 
> With the present implementation find statemnt return the regular

"statement"

> executable files under bin,sbin and usr/lib/gcc* which contains the
> script files as well.
> 
> Actually we are tuning interp and rpath only for ELF executable, hence
> added additional condition in the find statement to return only ELF
> executable.
> 
> With this change we are avoiding unncessarily checking the interpreter
> for non ELF executable files.
> 

"unnecessarily"

Just for clarity: Is this an optimization or a bug fix?

Thanks,
Jan

> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
>  meta/recipes-devtools/sdk-files/files/relocate-sdk.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> index 82f63b30..e02e71f4 100755
> --- a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> +++ b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> @@ -27,7 +27,7 @@ fi
>  
>  echo -n "Adjusting path of SDK to '${new_sdkroot}'... "
>  
> -for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/gcc* -executable -type f); do
> +for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin ${sdkroot}/usr/lib/gcc* -executable -type f -exec file {} \; | grep ELF | awk -F ':' '{ print $1 }'); do
>  	interpreter=$(patchelf --print-interpreter ${binary} 2>/dev/null)
>  	oldpath=${interpreter%/lib*/ld-linux*}
>  	interpreter=${interpreter#${oldpath}}

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/87190d5e-7741-43ce-9a91-9bf7f4278496%40siemens.com.

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

* Re: [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf
  2024-08-30  6:29 ` 'Jan Kiszka' via isar-users
@ 2024-08-30  6:38   ` Srinuvasan Arjunan
  2024-09-04  1:57     ` Srinuvasan Arjunan
  0 siblings, 1 reply; 5+ messages in thread
From: Srinuvasan Arjunan @ 2024-08-30  6:38 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: srinuvasan.a, isar-users

[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]

On Fri, Aug 30, 2024 at 11:59 AM 'Jan Kiszka' via isar-users <
isar-users@googlegroups.com> wrote:

> On 30.08.24 08:13, srinuvasan.a@siemens.com wrote:
> > From: Srinuvasan A <srinuvasan.a@siemens.com>
> >
> > With the present implementation find statemnt return the regular
>
> "statement"
>
> > executable files under bin,sbin and usr/lib/gcc* which contains the
> > script files as well.
> >
> > Actually we are tuning interp and rpath only for ELF executable, hence
> > added additional condition in the find statement to return only ELF
> > executable.
> >
> > With this change we are avoiding unncessarily checking the interpreter
> > for non ELF executable files.
> >
>
> "unnecessarily"
>
> Just for clarity: Is this an optimization or a bug fix?
>
> Thanks,
> Jan
>

   This is the optimization i would say

   Thanks,
    Srinu

>
> > Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> > ---
> >  meta/recipes-devtools/sdk-files/files/relocate-sdk.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> > index 82f63b30..e02e71f4 100755
> > --- a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> > +++ b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> > @@ -27,7 +27,7 @@ fi
> >
> >  echo -n "Adjusting path of SDK to '${new_sdkroot}'... "
> >
> > -for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin
> ${sdkroot}/usr/lib/gcc* -executable -type f); do
> > +for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin
> ${sdkroot}/usr/lib/gcc* -executable -type f -exec file {} \; | grep ELF |
> awk -F ':' '{ print $1 }'); do
> >       interpreter=$(patchelf --print-interpreter ${binary} 2>/dev/null)
> >       oldpath=${interpreter%/lib*/ld-linux*}
> >       interpreter=${interpreter#${oldpath}}
>
> --
> Siemens AG, Technology
> Linux Expert Center
>
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/87190d5e-7741-43ce-9a91-9bf7f4278496%40siemens.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/CAB2Z2nO4-yCgWHXTHmawptvi89cuYPGj6%2BA2nxAOsy488_cWXw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4244 bytes --]

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

* Re: [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf
  2024-08-30  6:38   ` Srinuvasan Arjunan
@ 2024-09-04  1:57     ` Srinuvasan Arjunan
  0 siblings, 0 replies; 5+ messages in thread
From: Srinuvasan Arjunan @ 2024-09-04  1:57 UTC (permalink / raw)
  To: isar-users


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



On Friday, August 30, 2024 at 12:08:18 PM UTC+5:30 Srinuvasan Arjunan wrote:

On Fri, Aug 30, 2024 at 11:59 AM 'Jan Kiszka' via isar-users <
isar-...@googlegroups.com> wrote:

On 30.08.24 08:13, srinuv...@siemens.com wrote:
> From: Srinuvasan A <srinuv...@siemens.com>
> 
> With the present implementation find statemnt return the regular

"statement"

> executable files under bin,sbin and usr/lib/gcc* which contains the
> script files as well.
> 
> Actually we are tuning interp and rpath only for ELF executable, hence
> added additional condition in the find statement to return only ELF
> executable.
> 
> With this change we are avoiding unncessarily checking the interpreter
> for non ELF executable files.
> 

"unnecessarily"

Just for clarity: Is this an optimization or a bug fix?

Thanks,
Jan


   This is the optimization i would say

   Thanks,
    Srinu 


> Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
> ---
>  meta/recipes-devtools/sdk-files/files/relocate-sdk.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh 
b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> index 82f63b30..e02e71f4 100755
> --- a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> +++ b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> @@ -27,7 +27,7 @@ fi
>  
>  echo -n "Adjusting path of SDK to '${new_sdkroot}'... "
>  
> -for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin 
${sdkroot}/usr/lib/gcc* -executable -type f); do
> +for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin 
${sdkroot}/usr/lib/gcc* -executable -type f -exec file {} \; | grep ELF | 
awk -F ':' '{ print $1 }'); do
>       interpreter=$(patchelf --print-interpreter ${binary} 2>/dev/null)
>       oldpath=${interpreter%/lib*/ld-linux*}
>       interpreter=${interpreter#${oldpath}}

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups 
"isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to isar-users+...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/isar-users/87190d5e-7741-43ce-9a91-9bf7f4278496%40siemens.com
.


      Hello All,

          Can you please merge this changes if no objection.

Many thanks,
Srinu 

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/6504fd75-8f8e-414b-818d-bbcd7724b07fn%40googlegroups.com.

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

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

* Re: [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf
  2024-08-30  6:13 [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf srinuvasan.a via isar-users
  2024-08-30  6:29 ` 'Jan Kiszka' via isar-users
@ 2024-09-06  5:58 ` Uladzimir Bely
  1 sibling, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2024-09-06  5:58 UTC (permalink / raw)
  To: srinuvasan.a, isar-users

On Fri, 2024-08-30 at 11:43 +0530, srinuvasan.a via isar-users wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
> 
> With the present implementation find statemnt return the regular
> executable files under bin,sbin and usr/lib/gcc* which contains the
> script files as well.
> 
> Actually we are tuning interp and rpath only for ELF executable,
> hence
> added additional condition in the find statement to return only ELF
> executable.
> 
> With this change we are avoiding unncessarily checking the
> interpreter
> for non ELF executable files.
> 
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
>  meta/recipes-devtools/sdk-files/files/relocate-sdk.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> index 82f63b30..e02e71f4 100755
> --- a/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> +++ b/meta/recipes-devtools/sdk-files/files/relocate-sdk.sh
> @@ -27,7 +27,7 @@ fi
>  
>  echo -n "Adjusting path of SDK to '${new_sdkroot}'... "
>  
> -for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin
> ${sdkroot}/usr/lib/gcc* -executable -type f); do
> +for binary in $(find ${sdkroot}/usr/bin ${sdkroot}/usr/sbin
> ${sdkroot}/usr/lib/gcc* -executable -type f -exec file {} \; | grep
> ELF | awk -F ':' '{ print $1 }'); do
>  	interpreter=$(patchelf --print-interpreter ${binary}
> 2>/dev/null)
>  	oldpath=${interpreter%/lib*/ld-linux*}
>  	interpreter=${interpreter#${oldpath}}
> -- 
> 2.34.1
> 

Applied to next (mentioned typos in commit message corrected), thanks.

-- 
Best regards,
Uladzimir.

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/6f3692085561b5d65cb5354e66f85e5ae8f09d09.camel%40ilbers.de.

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

end of thread, other threads:[~2024-09-06  5:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-30  6:13 [PATCH] sdk-files/files/relocate-sdk.sh: find only ELF executable before apply patchelf srinuvasan.a via isar-users
2024-08-30  6:29 ` 'Jan Kiszka' via isar-users
2024-08-30  6:38   ` Srinuvasan Arjunan
2024-09-04  1:57     ` Srinuvasan Arjunan
2024-09-06  5:58 ` Uladzimir Bely

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