From 3b973f1c9c9ee3fbe64903036ad93eb9e928b185 Mon Sep 17 00:00:00 2001 From: Roy Li Date: Tue, 17 Jun 2014 14:00:26 +0800 Subject: relocate_sdk: Skip to do relocation if the file size is less than 64 byte When toolchain directory is changed to execute mode, some non-executable files or empty files are sorted. This will lead to the below error: Extracting SDK...done Setting it up...Traceback (most recent call last): File "..._SDK/relocate_sdk.py", line 208, in arch = get_arch() File "..._SDK/relocate_sdk.py", line 39, in get_arch ei_mag0,ei_mag1_3,ei_class = struct.unpack(" Signed-off-by: Richard Purdie --- scripts/relocate_sdk.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py index 05d9fd65ed..b2dd258c34 100755 --- a/scripts/relocate_sdk.py +++ b/scripts/relocate_sdk.py @@ -224,12 +224,12 @@ for e in executables_list: # Save old size and do a size check at the end. Just a safety measure. old_size = os.path.getsize(e) - - arch = get_arch() - if arch: - parse_elf_header() - change_interpreter(e) - change_dl_sysdirs() + if old_size >= 64: + arch = get_arch() + if arch: + parse_elf_header() + change_interpreter(e) + change_dl_sysdirs() """ change permissions back """ if perms: -- cgit 1.2.3-korg