repack: move sbin to /system ramdisk and update repacking
for android-10

This will support updating the ramdisk to a different
compression format and co-exist with magisk.

We are also cleaning up and removing non android-10
api makefile actions.

We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.

Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
diff --git a/prebuilt/relink.sh b/prebuilt/relink.sh
index 783e052..063f445 100755
--- a/prebuilt/relink.sh
+++ b/prebuilt/relink.sh
@@ -5,20 +5,15 @@
     dst=$1/$(basename $2)
     src=$2
 
-    if [ ! -e $src ]; then
-      return
-    fi
+    [[ -e $src ]] || return 0
 
     if [ $dst == $src ]; then
       cp -f -p $src $src.tmp
       src=$2.tmp
-    else
-      cp -f -p --remove-destination $src $dst
     fi
 
-    sed "s|/system/bin/linker64\x0|/sbin/linker64\x0\x0\x0\x0\x0\x0\x0|g" $src | sed "s|/system/bin/linker\x0|/sbin/linker\x0\x0\x0\x0\x0\x0\x0|g" | sed "s|/system/bin/sh\x0|/sbin/sh\x0\x0\x0\x0\x0\x0\x0|g" > $dst
-    #rm -f $src
-    [ -e $2.tmp ] && rm $2.tmp || echo
+    cp $src $dst
+    if [[ -e $2.tmp ]]; then rm -f $2.tmp; fi
 }