* [PATCH 1/2] relocate_sdk: fixed .gccrelocprefix section handling
@ 2016-03-23 8:35 Wenlin Kang
2016-03-23 8:35 ` [PATCH 2/2] toolchain-shar-extract.sh: limit the length for target_sdk_dir Wenlin Kang
0 siblings, 1 reply; 2+ messages in thread
From: Wenlin Kang @ 2016-03-23 8:35 UTC (permalink / raw)
To: openembedded-core
When fixing paths for .gccrelocprefix section, it will corrupt the next
entry during updating the current one if "new_prefix" length is more
than "DEFAULT_INSTALL_DIR", this problem is obvious on the code, but it's
only found when install sdk onto a net file system.
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
---
scripts/relocate_sdk.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index 992db5c..ceca1f2 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -166,6 +166,7 @@ def change_dl_sysdirs():
while (offset + 4096) <= sh_size:
path = f.read(4096)
new_path = old_prefix.sub(new_prefix, path)
+ new_path = new_path.rstrip(b("\0"))
# pad with zeros
new_path += b("\0") * (4096 - len(new_path))
#print "Changing %s to %s at %s" % (str(path), str(new_path), str(offset))
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] toolchain-shar-extract.sh: limit the length for target_sdk_dir
2016-03-23 8:35 [PATCH 1/2] relocate_sdk: fixed .gccrelocprefix section handling Wenlin Kang
@ 2016-03-23 8:35 ` Wenlin Kang
0 siblings, 0 replies; 2+ messages in thread
From: Wenlin Kang @ 2016-03-23 8:35 UTC (permalink / raw)
To: openembedded-core
Limit the length for target_sdk_dir, this can ensure the relocation
behaviour in relocate_sdk.py has the right result.
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
---
| 6 ++++++
1 file changed, 6 insertions(+)
--git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 12d39c3..0295bde 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -110,6 +110,12 @@ else
target_sdk_dir=$(readlink -m "$target_sdk_dir")
fi
+# limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result.
+if [ ${#target_sdk_dir} -gt 2048 ]; then
+ echo "Error: The target directory path is too long!!!"
+ exit 1
+fi
+
if [ "$SDK_EXTENSIBLE" = "1" ]; then
# We're going to be running the build system, additional restrictions apply
if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-23 8:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 8:35 [PATCH 1/2] relocate_sdk: fixed .gccrelocprefix section handling Wenlin Kang
2016-03-23 8:35 ` [PATCH 2/2] toolchain-shar-extract.sh: limit the length for target_sdk_dir Wenlin Kang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.