From: "Mikko Rapeli" <mikko.rapeli@bmw.de>
To: <pbarker@konsulko.com>
Cc: <Awais_Belal@mentor.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] toolchain-shar-relocate.sh: check for environment-setup beforehand
Date: Thu, 18 Jun 2020 08:04:01 +0000 [thread overview]
Message-ID: <20200618080401.GS108868@korppu> (raw)
In-Reply-To: <CAM9ZRVvciD5BRLYnimK1AN9_BGZ8J8oK=keywSv2EGbOkwjK+Q@mail.gmail.com>
On Thu, Jun 18, 2020 at 08:50:21AM +0100, Paul Barker wrote:
> On Wed, 17 Jun 2020 at 21:48, Awais Belal <Awais_Belal@mentor.com> wrote:
> >
> > The script runs a 'cat' on the script and if it isn't present in the
> > sdk the cat command waits on the std input and hence the installation
> > process simply sits there.
>
> That sort of error would typically be caused by the variable being
> unset rather than the variable being set to the path of a nonexistent
> file. I don't know much about the context this script runs in though
> so I may be missing something obvious.
I'd change the script to run with bash and "set -euo pipefail" to capture
errors like this early.
-Mikko
> >
> > Signed-off-by: Awais Belal <awais_belal@mentor.com>
> > ---
> > meta/files/toolchain-shar-relocate.sh | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
> > index e3c10018ef..02a05664c6 100644
> > --- a/meta/files/toolchain-shar-relocate.sh
> > +++ b/meta/files/toolchain-shar-relocate.sh
> > @@ -3,6 +3,12 @@ if ! xargs --version > /dev/null 2>&1; then
> > exit 1
> > fi
> >
> > +# check if we have a valid env-setup script
> > +if [ ! -f "$env_setup_script" ]; then
> > + echo "Main environment-setup file not found. 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*")
> > --
> > 2.17.1
>
>
>
> --
> Paul Barker
> Konsulko Group
>
next prev parent reply other threads:[~2020-06-18 8:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 20:47 [PATCH] toolchain-shar-relocate.sh: check for environment-setup beforehand Awais Belal
2020-06-18 7:50 ` [OE-core] " Paul Barker
2020-06-18 8:04 ` Mikko Rapeli [this message]
2020-06-18 10:13 ` Awais Belal
2020-06-18 11:28 ` Mikko Rapeli
2020-06-18 10:09 ` Awais Belal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200618080401.GS108868@korppu \
--to=mikko.rapeli@bmw.de \
--cc=Awais_Belal@mentor.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=pbarker@konsulko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox