-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Experimental support for recent Android versions - General fixes - Major optimizations
- Loading branch information
Showing
13 changed files
with
487 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,65 @@ | ||
Daemon to remount folders periodically | ||
Android 11 storage isolation support | ||
|
||
~# bindfs -u $(stat -c %u /sdcard/Android/data/com.termux) -g 9997 -p a-rwx,ug+rw,ug+X /mnt/media_rw/[UUID]/Android/data/com.termux /mnt/runtime/write/emulated/0/Android/data/com.termux | ||
|
||
bindfs approach | ||
~# DIR=/mnt/media_rw/[UUID] # for Portable Storage | ||
~# DIR=/mnt/expand/[UUID] # for Adoptable Storage | ||
~# mkdir $DIR/WhatsApp | ||
~# mv /sdcard/WhatsApp/* $DIR/WhatsApp/ | ||
~# bindfs -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore $DIR/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp | ||
|
||
mount sdcard manually | ||
~# mount -t exfat -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0,uid=0,gid=9997,fmask=0117,dmask=0006 /dev/block/sda1 /mnt/runtime/write/emulated/0/WhatsApp | ||
~# mv /data/media/0/WhatsApp/* /sdcard/WhatsApp/ | ||
~# mount -o bind /mnt/my_sdcard/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp | ||
|
||
sdcardfs approach | ||
~# mkdir /mnt/expand/[UUID]/media/0/WhatsApp | ||
~# mv /sdcard/WhatsApp/* /mnt/expand/[UUID]/media/0/WhatsApp/ | ||
~# restorecon -rv /mnt/expand/[UUID]/media/ | ||
~# mount -t sdcardfs -o nosuid,nodev,noexec,noatime,mask=7,gid=9997 /mnt/expand/[UUID]/media/0/WhatsApp /mnt/runtime/write/emulated/0/Whatsapp | ||
|
||
|
||
#!/data/data/com.termux/files/usr/bin/bash -e | ||
|
||
# must be run with root privileges | ||
[ $(id -u) -eq 0 ] || exec su --mount-master -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH HOME=$HOME PATH=$PATH:$HOME/bin $0" | ||
|
||
# make sure to be in root mount namespace | ||
[ $(readlink /proc/1/ns/mnt) = $(readlink /proc/self/ns/mnt) ] || nsenter -t 1 -m -- "$0" | ||
|
||
Unmount() { | ||
fusermount -u /mnt/runtime/write/emulated/0/GDrive 2>/dev/null || : | ||
} | ||
|
||
# make sure it's not already mounted | ||
Unmount | ||
|
||
# make sure it's unmounted after rclone is killed | ||
trap 'sleep 1; Unmount' EXIT | ||
|
||
# mount remote in /sdcard/ | ||
rclone -v mount GDrive: /mnt/runtime/write/emulated/0/GDrive --gid 9997 --dir-perms 0771 --file-perms 0660 --umask=0 --allow-other | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
for i in /mnt/runtime/*/emulated/0/testdir; do umount $i; done 2>/dev/null; rm -rf /mnt/media_rw/72CA-0EF5/testdir /sdcard/testdir 2>/dev/null; mkdir -p /mnt/media_rw/72CA-0EF5/testdir /sdcard/testdir; touch /mnt/media_rw/72CA-0EF5/testdir/testfile; su -Mc /data/bindfs -o nonempty,nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/write/emulated/0/testdir; ls /sdcard/testdir/testfile | ||
|
||
su -Mc /data/bindfs -o nonempty,nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/default/emulated/0/testdir; su -Mc /data/bindfs -o nonempty,nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/read/emulated/0/testdir | ||
|
||
|
||
for i in /mnt/runtime/*/emulated/0/testdir; do umount $i; done 2>/dev/null; rm -rf /mnt/media_rw/72CA-0EF5/testdir /sdcard/testdir 2>/dev/null; mkdir -p /mnt/media_rw/72CA-0EF5/testdir /sdcard/testdir; touch /mnt/media_rw/72CA-0EF5/testdir/testfile; su -Mc /system/bin/mount -t sdcardfs -o rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/write/emulated/0/testdir; ls /sdcard/testdir/testfile | ||
|
||
su -Mc /system/bin/mount -t sdcardfs -o rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/default/emulated/0/testdir; su -Mc /system/bin/mount -t sdcardfs -o rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid /mnt/media_rw/72CA-0EF5/testdir /mnt/runtime/read/emulated/0/testdir | ||
|
||
|
||
#!/system/bin/sh | ||
while [ ! -b /dev/block/mmcblk1p1 ]; do sleep 2; done | ||
mkdir -p mnt/extsd | ||
su -Mc /system/bin/mount -t vfat -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0,uid=0,gid=9997,fmask=0117,dmask=0006 /dev/block/mmcblk1p1 /mnt/extsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
set_perm $MODPATH/system/bin/fbind 0 2000 0755 | ||
rm $MODPATH/TODO.txt $MODPATH/License.md | ||
|
||
dataDir=/data/adb/vr25/fbind | ||
dataDir=/data/adb/vr25/fbind-data | ||
[ -d ${dataDir%-*} ] && [ ! -d $dataDir ] && mv ${dataDir%-*} $dataDir ### | ||
mkdir -p $dataDir | ||
unzip -o "$ZIPFILE" README.md -d $dataDir/ >&2 | ||
|
||
# Preserve FUSE state | ||
if [ -f $dataDir/.FUSE ] || [ /data/adb/modules/fbind/system.prop ]; then | ||
if [ -f $dataDir/.FUSE ] || [ -f /data/adb/modules/fbind/system.prop ]; then | ||
mv $MODPATH/FUSE.prop $MODPATH/system.prop | ||
fi | ||
|
||
# Migrate old config and remove legacy fbind | ||
[ -f $dataDir/config.txt ] || cp /data/adb/fbind*/config.txt $dataDir/ 2>/dev/null | ||
rm -rf /data/adb/fbind* /data/adb/modules/fbind /sdcard/Download/fbind /sdcard/*fbind*.txt 2>/dev/null | ||
|
||
# Print links and changelog | ||
printf '\n\n' | ||
sed -En "\|## LINKS|,\$p" $dataDir/README.md \ | ||
| grep -v '^---' | sed 's/^## //' | ||
printf '\n\n' | ||
rm -rf ${dataDir%-*} /data/adb/fbind* /sdcard/Download/fbind /sdcard/*fbind*.txt 2>/dev/null | ||
|
||
# Make executable readily available | ||
executable=$MODPATH/system/bin/fbind | ||
tmpd=/dev/.vr25/fbind | ||
mkdir -p $tmpd | ||
ln -fs $executable $tmpd/ | ||
ln -fs $executable /sbin/ 2>/dev/null | ||
|
||
# Print links and changelog | ||
printf '\n\n' | ||
sed -En "\|## LINKS|,\$p" $dataDir/README.md \ | ||
| grep -v '^---' | sed 's/^## //' | ||
printf '\n\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
id=vr25.fbind | ||
name=fbind | ||
version=v2021.3.4 | ||
versionCode=202103040 | ||
version=v2021.11.11-beta | ||
versionCode=202111110 | ||
author=VR25 @ xda-developers | ||
description=fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more. |
Oops, something went wrong.