From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Wed, 14 Feb 2018 12:01:26 +0200 Subject: [U-Boot] [PATCH] script: Make the get_default_envs.sh script working with newest u-boot In-Reply-To: <20180214095017.52530b9f@jawa> References: <20180213220113.14600-1-lukma@denx.de> <20180214032558.1ba7dde6@duuni> <20180214095017.52530b9f@jawa> Message-ID: <20180214120126.4ff8fc3d@duuni> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 14 Feb 2018 09:50:17 +0100 Lukasz Majewski wrote: > On Wed, 14 Feb 2018 03:25:58 +0200 > Tuomas Tynkkynen wrote: > > > Hi, > > > > On Tue, 13 Feb 2018 23:01:13 +0100 > > Lukasz Majewski wrote: > > > > > This commit fixes several issues: > > > > > > - After moving env related code to ./env directory the env_common.o > > > file is no longer present in the system (has been replaced with > > > built-in.o). > > > > > > - Use ${OBJCOPY} if available, fallback to system default's objcopy > > > if not present. > > > > > > - Extend the script to accept different build directory than > > > current one. It is extremely handy with OE usage, where source code > > > is separated from build. > > > > > > Signed-off-by: Lukasz Majewski > > > --- > > > > > > scripts/get_default_envs.sh | 19 ++++++++++++++----- > > > 1 file changed, 14 insertions(+), 5 deletions(-) > > > > > > diff --git a/scripts/get_default_envs.sh > > > b/scripts/get_default_envs.sh index 7955db60e5..bbb6d0a6ef 100755 > > > --- a/scripts/get_default_envs.sh > > > +++ b/scripts/get_default_envs.sh > > > @@ -6,16 +6,24 @@ > > > # > > > > > > # This file extracts default envs from built u-boot > > > -# usage: get_default_envs.sh > u-boot-env-default.txt > > > +# usage: get_default_envs.sh [build dir] > u-boot-env-default.txt > > > set -ue > > > > > > -ENV_OBJ_FILE="env_common.o" > > > +: "${OBJCOPY:=objcopy}" > > > > Maybe "${CROSS_COMPILE}objcopy" would be a better default as that's > > what the build system uses. > > Unfortunately not with OE builds. In OE, the OBJCOPY is set to arm > specific objcopy. > > With fallback (objcopy) from your local machine - it depends if it > supports multi arch or not. No, I meant that instead of having a fallback of "objcopy", have a fallback of "${CROSS_COMPILE}objcopy". I.e. squashing this change: diff --git a/scripts/get_default_envs.sh b/scripts/get_default_envs.sh index 3e532d12c4..184cc19ab7 100755 --- a/scripts/get_default_envs.sh +++ b/scripts/get_default_envs.sh @@ -9,7 +9,7 @@ # usage: get_default_envs.sh [build dir] > u-boot-env-default.txt set -ue -: "${OBJCOPY:=objcopy}" +: "${OBJCOPY:=${CROSS_COMPILE:-}objcopy}" ENV_OBJ_FILE="built-in.o" ENV_OBJ_FILE_COPY="copy_${ENV_OBJ_FILE}" That way the script works out-of-the-box for people who do the usual export CROSS_COMPILE=aarch64-linux-gnu- (or whatever) when building U-Boot.