[elbe-devel] [PATCH v2 15/24] toolchain-extract.sh: add some sections

Torben Hohn torben.hohn at linutronix.de
Thu Feb 8 15:34:14 CET 2018


On Thu, Feb 08, 2018 at 02:17:01PM +0100, Manuel Traut wrote:
> Some sections are auto-generated during a poky build. These parts are
> inserted at placeholders by bitbake.
> 
> Because things are more static in elbe, the relevant parts are copied
> from a bitbake generated
> poky-glibc-x86_64-core-image-minimal-i586-toolchain-2.4.1.sh
> script.
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/makofiles/toolchain-shar-extract.sh.mako | 52 ++++++++++++++++++++++-
>  1 file changed, 51 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/makofiles/toolchain-shar-extract.sh.mako b/elbepack/makofiles/toolchain-shar-extract.sh.mako
> index 83a4ed27..126ea587 100644
> --- a/elbepack/makofiles/toolchain-shar-extract.sh.mako
> +++ b/elbepack/makofiles/toolchain-shar-extract.sh.mako
> @@ -274,7 +274,57 @@ if [ -n "$real_env_setup_script" ] ; then
>  	env_setup_script="$real_env_setup_script"
>  fi
>  
> - at SDK_POST_INSTALL_COMMAND@
> +if ! xargs --version > /dev/null 2>&1; then
> +        echo "xargs is required by the relocation script, please install it first. Abort!"
> +        exit 1
> +fi
> +
> +# fix dynamic loader paths in all ELF SDK binaries
> +native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"')
> +dl_path=$($SUDO_EXEC find $native_sysroot/lib -name "ld-linux*")
> +if [ "$dl_path" = "" ] ; then
> +        echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
> +        exit 1
> +fi
> +executable_files=$($SUDO_EXEC find $native_sysroot -type f \
> +        \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ")
> +if [ "x$executable_files" = "x" ]; then
> +   echo "SDK relocate failed, could not get executalbe files"
> +   exit 1
> +fi
> +
> +tdir=`mktemp -d`
> +if [ x$tdir = x ] ; then
> +   echo "SDK relocate failed, could not create a temporary directory"
> +   exit 1
> +fi
> +cat <<EOF >> $tdir/relocate_sdk.sh
> +#!/bin/sh
> +for py in python python2 python3
> +do
> +        PYTHON=\`which \${py} 2>/dev/null\`
> +        if [ \$? -eq 0 ]; then
> +                break;
> +        fi
> +done
> +
> +if [ x\${PYTHON} = "x"  ]; then
> +        echo "SDK could not be relocated.  No python found."
> +        exit 1
> +fi
> +\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
> +EOF
> +
> +$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
> +$SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
> +rm -rf $tdir
> +if [ $relocate = 1 ] ; then
> +        $SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.sh
> +        if [ $? -ne 0 ]; then
> +                echo "SDK could not be set up. Relocate script failed. Abort!"
> +                exit 1
> +        fi
> +fi
>  
>  # delete the relocating script, so that user is forced to re-run the installer
>  # if he/she wants another location for the sdk
> -- 
> 2.15.1
> 

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180208/fcc1b595/attachment.sig>


More information about the elbe-devel mailing list