Guest User

Mount scripts ref. symblinks of only some apps disappear

a guest
Apr 17th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.06 KB | None | 0 0
  1. # This is the mount script that I stick inside  magisk and run. Initially I tried fbind module did not work neither did apps2sd mount script both these had loops and sleep functions that  looked for mount detection conditons which weren't met and so they did nothing to mount . So instead I just  did a plain 101 mount with sleep and I could mount what I wanted to
  2.  
  3. #----------------------------------------------------------------------------------------------------------------------------
  4.  
  5. set -x
  6. altExtsd=false
  7.  
  8. alias mount="/sbin/su -Mc mount -o rw,noatime"
  9. [ -z "$interactiveMode" ] && interactiveMode=false
  10.  
  11.  
  12.  
  13.  
  14. mount -t ext4   /dev/block/mmcblk1p2 /data/sdext2
  15.  
  16.  
  17. #mount -t ext4   /dev/block/mmcblk1p1 /data/extsd
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. sleep 0.1
  25.  
  26. mount -t ext4   /dev/block/mmcblk1p2 /data/sdext2
  27.  
  28. #mount -t ext4   /dev/block/mmcblk1p1 /data/extsd
  29.  
  30. ------------------------------------------------------------------------------------------------------------------------------
  31.  
  32. # this is the original apps2sd script  00000000apps2sd-main.sh that never worked reasons explained above. I tossed this here after  the my own script got working. I dunno if its doing anything
  33. 1|PrKr:/data/adb/modules/fbind # cd /system/add*
  34. olivelite:/system/addon.d # ls
  35. 00000000apps2sd-main.sh 50-havoc.sh 70-gapps.sh 99-busybox.sh 99-magisk.sh apps2sd-mount blacklist busybox-install-dir
  36. ----------------------------------------------------------------------------------------------------------------------'
  37. #!/system/bin/sh
  38. count=0
  39. LOG=/data/apps2sd-log/apps2sd-mount-script.log
  40. rm $LOG
  41. rm -f $LOG
  42. echo "$(date) Starting..." > $LOG
  43. contains() {
  44.    string="$1"
  45.    substring="$2"
  46.    if test "${string#*$substring}" != "$string"
  47.    then
  48.        return 0
  49.    else
  50.        return 1
  51.    fi
  52. }
  53. while ! ls "/dev/block/mmcblk1p2" 1> /dev/null 2>&1;
  54. do
  55.    count=`expr $count + 1`
  56.    if test $count -ge 100
  57.    then
  58.        break
  59.    else
  60.        sleep 0.1
  61.    fi
  62. done
  63. ls -d "/data/sdext2" 1>>$LOG 2>>$LOG
  64. ls -d "/dev/block/mmcblk1p2" 1>>$LOG 2>>$LOG
  65. if ! ls "/dev/block/mmcblk1p2" 1> /dev/null 2>&1;
  66. then
  67.    echo "/dev/block/mmcblk1p2 not found" 1>>$LOG 2>>$LOG
  68. else
  69.    while ! ls -d "/data/sdext2" 1> /dev/null 2>&1;
  70.    do
  71.        count=`expr $count + 1`
  72.        if test $count -ge 100
  73.        then
  74.            break
  75.        else
  76.            sleep 0.1
  77.        fi
  78.    done
  79.    sleep 0.5
  80.    if ! mountpoint -q "/data/sdext2"
  81.    then
  82.        mountres=`mount -t ext4 -o noatime,rw /dev/block/mmcblk1p2 /data/sdext2 2>&1 > /dev/null`
  83.        mountret=$?
  84.        while test $mountret -ne 0
  85.        do
  86.            if contains "$mountres" "nvalid argument"
  87.            then
  88.                echo "\n******************************************\n2nd partition filesystem is invalid\n******************************************\n" 1>>$LOG 2>>$LOG
  89.                break
  90.            else
  91.                count=`expr $count + 1`
  92.                if test $count -ge 400
  93.                then
  94.                    break
  95. ←[7m--More--(34% of 4343 bytes)
  96.                else4343 bytes)←[0m←[1K
  97.                    if mount -t ext4 -o noatime,rw /dev/block/vold/public:179,66 /data/sdext2
  98.                    then
  99.                        break
  100.                    else
  101.                        sleep 0.1
  102.                    fi
  103.                fi
  104.            fi
  105.            mountres=`mount -t ext4 -o noatime,rw /dev/block/mmcblk1p2 /data/sdext2 2>&1 > /dev/null`
  106.            mountret=$?
  107.        done
  108.        mount -t ext4 -o noatime,rw /dev/block/mmcblk1p2 /data/sdext2 1>>$LOG 2>>$LOG
  109.        mount -t ext4 -o noatime,rw /dev/block/vold/public:179,66 /data/sdext2 1>>$LOG 2>>$LOG
  110.        chmod 775 /data/dalvik-cache
  111.        chmod 775 /data/dalvik-cache/arm
  112.        chmod 775 /data/data
  113.    else
  114.        echo "2nd partition already mounted..." 1>>$LOG 2>>$LOG
  115.    fi
  116. fi
  117. find /data/app -type l \( -name "*.odex" -o -name "*.apk" -o -name "lib" \) -exec chcon -h u:object_r:mnt_user_file:s0 {} \; 2> /dev/null 1> /dev/null
  118. while ! mountpoint -q "/storage/emulated/0"
  119. do
  120.    count=`expr $count + 1`
  121.    if mountpoint -q /mnt/runtime/default/emulated
  122.    then
  123.        break
  124.    elif mountpoint -q /storage/emulated
  125.    then
  126.        break
  127.    elif test $count -ge 1200
  128.    then
  129.        break
  130.    else
  131.        sleep 0.1
  132.    fi
  133. done
  134. if ! ls "/dev/block/vold/public:179,65" 1> /dev/null 2>&1;
  135. then
  136.    echo "/dev/block/vold/public:179,65 not found" 1>>$LOG 2>>$LOG
  137. else
  138.    while ! mountpoint -q "/storage/7c507255-fd07-ac0b-cd5a-d34743edfc21"
  139.    do
  140.        count=`expr $count + 1`
  141.        if test $count -ge 1200
  142.        then
  143.            break
  144.        else
  145.            sleep 0.1
  146.        fi
  147.    done
  148. fi
  149. sleep 0.5
  150. if ! mountpoint -q "/mnt/runtime/default/emulated/0/Android/obb/com.whatsapp"
  151. then
  152.    /apps2sd sdcardfsm "/data/sdext2/Android/obb/com.whatsapp" "/mnt/runtime/default/emulated/0/Android/obb/com.whatsapp" 1>> $LOG 2>> $LOG
  153. fi
  154.        echo "2nd partition already mounted..." 1>>$LOG 2>>$LOG
  155.    fi
  156. fi
  157. find /data/app -type l \( -name "*.odex" -o -name "*.apk" -o -name "lib" \) -exec chcon -h u:object_r:mnt_user_file:s0 {} \; 2> /dev/null 1> /dev/null
  158. while ! mountpoint -q "/storage/emulated/0"
  159. do
  160.    count=`expr $count + 1`
  161.    if mountpoint -q /mnt/runtime/default/emulated
  162.    then
  163.        break
  164.    elif mountpoint -q /storage/emulated
  165.    then
  166.        break
  167.    elif test $count -ge 1200
  168.    then
  169.        break
  170.    else
  171.        sleep 0.1
  172.    fi
  173. done
  174. if ! ls "/dev/block/vold/public:179,65" 1> /dev/null 2>&1;
  175. then
  176.    echo "/dev/block/vold/public:179,65 not found" 1>>$LOG 2>>$LOG
  177. else
  178.    while ! mountpoint -q "/storage/7c507255-fd07-ac0b-cd5a-d34743edfc21"
  179.    do
  180.        count=`expr $count + 1`
  181.        if test $count -ge 1200
  182.        then
  183.            break
  184.        else
  185.            sleep 0.1
  186.        fi
  187.    done
  188. fi
  189. sleep 0.5
  190. if ! mountpoint -q "/mnt/runtime/default/emulated/0/Android/obb/com.whatsapp"
  191. then
  192.    /apps2sd sdcardfsm "/data/sdext2/Android/obb/com.whatsapp" "/mnt/runtime/default/emulated/0/Android/obb/com.whatsapp" 1>> $LOG 2>> $LOG
  193. fi
  194. if ! mountpoint -q "/mnt/runtime/default/emulated/0/Android/data/com.whatsapp"
  195. then
  196.    /apps2sd sdcardfsm "/data/sdext2/Android/data/com.whatsapp" "/mnt/runtime/default/emulated/0/Android/data/com.whatsapp" 1>> $LOG 2>> $LOG
  197. fi
  198. if ! mountpoint -q "/mnt/runtime/default/emulated/0/DCIM"
  199. then
  200.    /apps2sd sdcardfsm "/mnt/media_rw/7c507255-fd07-ac0b-cd5a-d34743edfc21/DCIM" "/mnt/runtime/default/emulated/0/DCIM" 1>> $LOG 2>> $LOG
  201. fi
  202. if ! mountpoint -q "/mnt/runtime/default/emulated/0/WhatsApp"
  203. then
  204.    /apps2sd sdcardfsm "/mnt/media_rw/2C4C-FEC0/WhatsApp" "/mnt/runtime/default/emulated/0/WhatsApp" 1>> $LOG 2>> $LOG
  205. fi
  206. if ! mountpoint -q "/mnt/runtime/default/emulated/0/TitaniumBackup"
  207. then
  208.    /apps2sd sdcardfsm "/mnt/runtime/write/7c507255-fd07-ac0b-cd5a-d34743edfc21/TitaniumBackup" "/mnt/runtime/default/emulated/0/TitaniumBackup" 1>> $LOG 2>> $LOG
  209. fi
  210. echo "\n******************************************\nMount output\n******************************************" >> $LOG
  211. mount >> $LOG
Add Comment
Please, Sign In to add comment