From: Sundeep KOKKONDA Date: Tue, 5 Apr 2022 09:58:19 +0000 (+0530) Subject: meta: scripts - relocation script adapted to support big-endian machines X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~4512 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d6f4b1373e4dfafc63702ef2426cd45100f18a3;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py index 8c0fdb986aa..4ed8bfc0d1c 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("