[elbe-devel] [PATCH] Make SDK install script buster compatible

Torben Hohn torben.hohn at linutronix.de
Wed Oct 23 11:54:13 CEST 2019


On Wed, Oct 23, 2019 at 10:08:27AM +0200, John Ogness wrote:
> On 2019-10-22, bage at linutronix.de wrote:
> > From: Bastian Germann <bage at linutronix.de>
> >
> > The SDK install script searches for ld-linux.so* in $native_sysroot/lib which
> 
> No, it searches for ld-linux*
> 
> > is not available on buster (tested for armhf target).
> >
> > Search the whole $native_sysroot directory to find files in usr/lib as well.
> >
> > Signed-off-by: Bastian Germann <bage at linutronix.de>
> > ---
> >  elbepack/makofiles/toolchain-shar-extract.sh.mako | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/elbepack/makofiles/toolchain-shar-extract.sh.mako b/elbepack/makofiles/toolchain-shar-extract.sh.mako
> > index a56d1ae8c..7e432d125 100644
> > --- a/elbepack/makofiles/toolchain-shar-extract.sh.mako
> > +++ b/elbepack/makofiles/toolchain-shar-extract.sh.mako
> > @@ -282,7 +282,7 @@ fi
> >  
> >  # fix dynamic loader paths in all ELF SDK binaries
> >  native_sysroot=$target_sdk_dir/sysroots/host
> > -dl_path=$($SUDO_EXEC find $native_sysroot/lib -name "ld-linux*")
> > +dl_path=$($SUDO_EXEC find $native_sysroot -name "ld-linux.so*")
> 
> This is a problem for several reasons:
> 
> 1. ld-linux.so* does not match the dynamic loader for other
>    architectures

hmm... please name them.
this is a mako template, we know the target architecture, and the target
suite.

we can change from searching to a "hardcoded" matrix[suite][arch]
we have something similar already in elbepack/xmldefaults.py
this is not suite dependent though.

this will at least make the generated script simpler.
I prefer having somthing implemented in python, which yields
less moving parts in the generated shell scripts.



> 
> 2. searching that openly could match unintentional files
> 
> IMO it should look more like this:
> 
> dl_path=''
> for p in $native_sysroot/lib $native_sysroot/usr/lib; do
>     test -d $p && ! test -L $p || continue
>     dl_path=$($SUDO_EXEC find $p -name 'ld-linux*')
>     break
> done
> 
> Actually, there are quite a few things that the script does that I find
> horribly hacky. But the above suggestion should at least let things work
> as good as before, but for stretch and buster.

can you list them ?
i am not happy at all with this script.

This script is based on a script from yocto.
but we should start to move more logic into mako/python.

hmm... that said, i actually dont think, that the dynamic linker
actually changes, maybe its just the /lib link, that is broken in the
sysroot ?

i mean... the linker should always be /lib/ld-linux*, shouldnt it ?
where that link points to, is another question, though.

> 
> John Ogness

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list