summaryrefslogtreecommitdiffstats
path: root/prebuilt/relink.sh
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-09-05 21:24:24 +0200
committerDees_Troy <dees_troy@teamw.in>2012-09-05 21:24:31 +0200
commit51a0e82eb29a6dfc79f93479883383fbdbf8bcc2 (patch)
tree52fc18206eb0feba9f50dc3b0ede9fdc5e40f35e /prebuilt/relink.sh
parentInitial stub of partitions.hpp (diff)
downloadandroid_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.gz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.bz2
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.lz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.xz
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.tar.zst
android_bootable_recovery-51a0e82eb29a6dfc79f93479883383fbdbf8bcc2.zip
Diffstat (limited to '')
-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