From: Laurentiu Palcu Date: Tue, 31 Jul 2012 08:49:35 +0000 (+0300) Subject: scripts: add script for relocating the SDK X-Git-Tag: 2015-4~9699 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=3d366f4953962566f33a3d77d65ed0bd2c48f922;p=openembedded-core.git scripts: add script for relocating the SDK This script will be embedded in the SDK tarball and will be called by the SDK installer. It replaces the interpreter path in all binaries and it also changes the ld.so.cache and SYSDIRS in dynamic loader. Signed-off-by: Laurentiu Palcu Signed-off-by: Richard Purdie --- diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py new file mode 100755 index 0000000000..b247e65ce3 --- /dev/null +++ b/scripts/relocate_sdk.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# +# Copyright (c) 2012 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# DESCRIPTION +# This script is called by the SDK installer script. It replaces the dynamic +# loader path in all binaries and also fixes the SYSDIR paths/lengths and the +# location of ld.so.cache in the dynamic loader binary +# +# AUTHORS +# Laurentiu Palcu +# + +import struct +import sys +import stat +import os +import re + +old_prefix = re.compile("##DEFAULT_INSTALL_DIR##") + +def get_arch(): + f.seek(0) + e_ident =f.read(16) + ei_mag0,ei_mag1_3,ei_class = struct.unpack("