From cb63a881f73cd7ebbf26e47d600da0a6d7aa4eb0 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 23 Apr 2018 14:09:02 +0900 Subject: [PATCH] script: Make the get_default_envs.sh script working with cross compile To support cross compile, partilly pick from mainline commit. Base commit: 0778e7c50ba1 ("script: Make the get_default_envs.sh script working with newest u-boot") Change-Id: I35d89cd30eafe83de648aec48e2698396bfaf3dc Signed-off-by: Seung-Woo Kim --- scripts/get_default_envs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/get_default_envs.sh b/scripts/get_default_envs.sh index 7955db6..22848de 100755 --- a/scripts/get_default_envs.sh +++ b/scripts/get_default_envs.sh @@ -9,6 +9,8 @@ # usage: get_default_envs.sh > u-boot-env-default.txt set -ue +: "${OBJCOPY:=${CROSS_COMPILE:-}objcopy}" + ENV_OBJ_FILE="env_common.o" ENV_OBJ_FILE_COPY="copy_${ENV_OBJ_FILE}" @@ -24,7 +26,7 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} # NOTE: objcopy saves its output to file passed in # (copy_env_common.o in this case) -objcopy -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY} +${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY} # Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u -- 2.7.4