1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-11 04:19:50 +00:00

relocate_sdk.py: remove hardcoded SDK path

This patch removes hardcodes added to relocate_sdk.py
during SDK build, making it flexible and reusable.
Now default SDK path is passed to the script as
parameter rather then harcoded inside it.

This allows to reuse this script for multiple
relocations, and adds possibility to relocate
SDK multiple times

(From OE-Core rev: 6671a4d980c8bef8f402780a308f6c43a25044aa)

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ruslan Bilovol
2017-11-22 13:20:05 +02:00
committed by Richard Purdie
parent 2019f78260
commit bf5b43495a
3 changed files with 10 additions and 14 deletions
+9 -8
View File
@@ -38,8 +38,6 @@ else:
def b(x):
return x.encode(sys.getfilesystemencoding())
old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
def get_arch():
f.seek(0)
e_ident =f.read(16)
@@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
f.write(sysdirslen)
# MAIN
if len(sys.argv) < 4:
if len(sys.argv) < 5:
sys.exit(-1)
# In python > 3, strings may also contain Unicode characters. So, convert
# them to bytes
if sys.version_info < (3,):
new_prefix = sys.argv[1]
new_dl_path = sys.argv[2]
new_prefix = sys.argv[2]
new_dl_path = sys.argv[3]
else:
new_prefix = sys.argv[1].encode()
new_dl_path = sys.argv[2].encode()
new_prefix = sys.argv[2].encode()
new_dl_path = sys.argv[3].encode()
executables_list = sys.argv[3:]
executables_list = sys.argv[4:]
old_prefix_ne = b(sys.argv[1])
old_prefix = re.compile(re.escape(old_prefix_ne));
for e in executables_list:
perms = os.stat(e)[stat.ST_MODE]