Limit the length for target_sdk_dir, this can ensure the relocation
behaviour in relocate_sdk.py has the right result.

Signed-off-by: Wenlin Kang <[email protected]>
---
 meta/files/toolchain-shar-extract.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/files/toolchain-shar-extract.sh 
b/meta/files/toolchain-shar-extract.sh
index 12d39c3..0295bde 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -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
-- 
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to