summaryrefslogtreecommitdiffstats
path: root/prebuilt/relink.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prebuilt/relink.sh')
-rwxr-xr-xprebuilt/relink.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/prebuilt/relink.sh b/prebuilt/relink.sh
new file mode 100755
index 000000000..4e9445aeb
--- /dev/null
+++ b/prebuilt/relink.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+process_file()
+{
+ dst=$1/$(basename $2)
+ src=$2
+ if [ $dst == $src ]; then
+ cp -f -p $src $src.tmp
+ src=$2.tmp
+ else
+ cp -f -p $src $dst
+ fi
+
+ sed "s|/system/bin/linker\x0|/sbin/linker\x0\x0\x0\x0\x0\x0\x0|g" $src | sed "s|/system/bin/sh\x0|/sbin/sh\x0\x0\x0\x0\x0\x0\x0|g" > $dst
+
+ if [ $1 == $(dirname $2) ]; then
+ rm -f $src
+ fi
+}
+
+
+dest=$1
+shift 1
+for ARG in $*
+do
+ process_file $dest $ARG
+done