toolchain-shar-extract.sh: check the length for target_sdk_dir

Check the length for target_sdk_dir to ensure the relocation
behaviour in relocate_sdk.py is correct.

(From OE-Core rev: 2145bd0d188158c2db85b583b4d7f3ad4612593b)

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Wenlin Kang 2016-03-23 16:35:49 +08:00 committed by Richard Purdie
parent c3c793b428
commit dd61341ff1
1 changed files with 6 additions and 0 deletions

View File

@ -110,6 +110,12 @@ else
target_sdk_dir=$(readlink -m "$target_sdk_dir")
fi
# limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result.
if [ ${#target_sdk_dir} -gt 2048 ]; then
echo "Error: The target directory path is too long!!!"
exit 1
fi
if [ "$SDK_EXTENSIBLE" = "1" ]; then
# We're going to be running the build system, additional restrictions apply
if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then