[Magisk] sieger007:
mounting custom ext4 partitions before OS Mounts them

Thanks for responding. I tried it out but it does not see to work .

config.txt :

##extsd_path /mnt/media_rw/26A2-1B04
##intsd_path /storage/emulated/0
##from_to Android .binds/Android
##from_to DCIM .binds/DCIM
##from_to Pictures .binds/Pictures
##from_to EasyVoiceRecorder .binds/EasyVoiceRecorder
##from_to Download .binds/Download
##from_to Movies .binds/Movies
##from_to Telegram .binds/Telegram
##from_to WhatsApp .binds/Whatsapp
# partition 1 (assuming it's /dev/block/mmcblk1p1)
part /dev/block/mmcblk1p1 /data/sdext2 "fsck -fy"
# partition 2 (assuming it's /dev/block/mmcblk1p2)
part -o nodev,noexec,nosuid /dev/block/mmcblk1p2 /storage/whatspart "fsck -fy"

# partition 3 (assuming it's /dev/block/mmcblk1p3)
part -o nodev,noexec,nosuid /dev/block/mmcblk1p3 /storage/extsd "fsck -fy"

via su -M the directories were already created expected under /storage

I pre-pended core.sh with a set -x to better follow what was happening

Here is my log

-rw-rw-rw- 1 root root 1885 2019-08-08 04:41 fbind-boot-ASUS_X00T_2.log
-rw-rw-rw- 1 root root 510 2019-08-08 03:55 fbind-boot-ASUS_X00T_2.log.old
shell@ASUS_X00T_2:/data/adb/fbind/logs # more *.log
more *.log
Thu Aug 8 04:41:50 IST 2019
versionCode=201901230
Device=ASUS_X00T_2

+ . /sbin/.core/img/fbind/core.sh
+ set -x
+ altExtsd=false
+ tmpf=/dev/fbind/tmpf
+ intsd=/data/media/0
+ obb=/data/media/obb
+ modData=/data/adb/fbind
+ config=/data/adb/fbind/config.txt
+ alias 'mount=/sbin/su -Mc mount -o rw,noatime'
+ '[' -z ']'
+ interactiveMode=false
+ '[' -e /data/adb/fbind/.fuse ']'
+ touch /data/adb/fbind/.fuse
+ grep -q noAutoMount /data/adb/fbind/config.txt
+ apply_config
+ '[' -e /data/adb/fbind/config.txt ']'
+ grep -iq ^permissive /data/adb/fbind/config.txt
+ grep -q 'fsck.*mmcblk1'
+ grep -v 'part ' /data/adb/fbind/config.txt
←[7m--More--(34% of 1885 bytes)
+ set +x
+ '[' /data/adb/fbind/config.txt -nt /data/media/0/.fbind_config_backup.txt ']'

+ cp -af /data/adb/fbind/config.txt /data/media/0/.fbind_config_backup.txt
+ mkdir -p /dev/fbind
+ >/dev/fbind/tmpf
+ grep -E '^extsd_path |^intsd_path |^part |^loop ' /data/adb/fbind/config.txt
+ . /dev/fbind/tmpf
+ part /dev/block/mmcblk1p1 /data/sdext2 'fsck -fy'
+ echo '/dev/block/mmcblk1p1 /data/sdext2'
+ grep -q '^\-o '
+ typeset 'pPath=/dev/block/mmcblk1p1'
+ typeset 'luksPass=/dev/block/mmcblk1p1'
+ '[' /dev/block/mmcblk1p1 '=' /dev/block/mmcblk1p1 ']'
+ luksPass=
+ sed 's/--L.*//'
+ echo mmcblk1p1
+ typeset 'pName=mmcblk1p1'
+ is_mounted /data/sdext2
+ 2>/dev/null
+ mountpoint -q /data/sdext2
+ wait_storage /dev/block/mmcblk1p1 /data/sdext2 fsck -fy
+ grep -Eq '/data/media/[1-9]|/storage/emulated|/mnt/runtime/default/'
+ echo /dev/block/mmcblk1p1 /data/sdext2 fsck -fy
+ grep -q /mnt/media_rw/
+ echo /dev/block/mmcblk1p1 /data/sdext2 fsck -fy
+ :
+ '[' 0 -ne 0 ']'
+ mkdir -p /data/sdext2
+ wait_until_true '[' -e /dev/block/mmcblk1p1 ']'
+ typeset 'count=0'
+ '[' 0 -ge 1800 ']'
+ count=2
+ '[' -n '[' ']'
+ '[' -e /dev/block/mmcblk1p1 ']'
+ break
+ grep -Eiq ' sdcardfs | fuse '
+ grep /storage/emulated /proc/mounts
+ exit 1

I have 3 EXT4 partition that the OS mounted with weird names.

shell@ASUS_X00T_2:/data/adb/fbind/logs # ls -al /storage
ls -al /storage
total 28
drwxr-xr-x 7 root root 140 2019-08-08 04:42 .
drwxr-xr-x 18 root root 0 1971-01-27 16:45 ..
drwxrwx--x 13 root sdcard_rw 4096 2019-06-26 17:26 49136b1d-c45a-4869-85ff-09a78a58283b
[B][I]# ext4 partition to be mounted as /data/ext2[/I][/B]
drwxrwx--x 98 root sdcard_rw 12288 2019-08-06 19:19 7c507255-fd07-ac0b-cd5a-d34743edfc21
[B][I]#to be mounted as /storage/whatspart
[/I][/B]drwxrwx--x 11 root sdcard_rw 4096 2019-08-07 13:25 dc3b1fde-36b7-69de-a5e5-06ba1de08cac
[B][I]# to be mounted as extsd[/I][/B]
drwx--x--x 4 root sdcard_rw 4096 2019-08-06 02:47 emulated
drwxr-xr-x 2 root root 60 1971-01-27 16:45 self

Here is what I wanted to do :

<> 3 partitions to be mounted as above ( see code ) esp the 1st /data/sdext2

<> Now since there are multiple partitions and it just happens that the 1st one isnt my Main external SD partition ( its # 3 as evident above ) . How do I let Android know that Partition #3 is the external sd card so when you think of external SD card - use #3 . . IS there a variable out there that I can add this value to ? Also in the absence of this - apps will see 3 partitions will they ask me which one is the External SD one or they'll just write to the 1st one ?

AFAIK all these can be seen by non Su apps

Any quick fixer or we'd wait on the next release. THANKS again for this we nderful swiss knife