From 7d6f4b1373e4dfafc63702ef2426cd45100f18a3 Mon Sep 17 00:00:00 2001 From: Sundeep KOKKONDA Date: Tue, 5 Apr 2022 15:28:19 +0530 Subject: meta: scripts - relocation script adapted to support big-endian machines relocate_sdk.py was developed for little-endian architures and when tries to install SDK for big-endian machines errors like below will be shown. Error: struct.error: unpack requires a string argument of length 32. SDK could not be set up. Relocate script failed. Abort! Error: IOError: [Errno 22] Invalid argument. SDK could not be set up. Relocate script failed. Abort! To fix this, script is modified to support big-endian architecture. Signed-off-by: Sundeep KOKKONDA Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/relocate_sdk.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py index 8c0fdb986a..4ed8bfc0d1 100755 --- a/scripts/relocate_sdk.py +++ b/scripts/relocate_sdk.py @@ -30,9 +30,16 @@ else: old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##")) def get_arch(): + global endian_prefix f.seek(0) e_ident =f.read(16) - ei_mag0,ei_mag1_3,ei_class = struct.unpack("