Files
android_bootable_recovery/prebuilt/relink.sh
Dees_Troy 51a0e82eb2 TWRP-ify AOSP code
Pull in most TWRP sources
Stub out partition management code
Make it compile -- probably will not boot
Kind of a mess but have to start somewhere
2012-09-05 15:24:31 -04:00

28 lines
459 B
Bash
Executable File

#!/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