Skip to content

Commit

Permalink
v2021.12.6 (202112060)
Browse files Browse the repository at this point in the history
- Added TOC to readme;
- General optimizations;
- Improved Android 11+ support.
  • Loading branch information
VR-25 committed Dec 6, 2021
1 parent fe1295a commit 27aff0a
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 30 deletions.
26 changes: 20 additions & 6 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@
<body class="vscode-body vscode-light">
<h1 id="fbind">fbind</h1>
<hr>
<ul>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#license">LICENSE</a></li>
<li><a href="#disclaimer">DISCLAIMER</a></li>
<li><a href="#warning">WARNING</a></li>
<li><a href="#pre-requisites">PRE-REQUISITES</a></li>
<li><a href="#config-syntax">CONFIG SYNTAX</a></li>
<li><a href="#config-examples">CONFIG EXAMPLES</a></li>
<li><a href="#terminal-commands">TERMINAL COMMANDS</a></li>
<li><a href="#notes">NOTES</a></li>
<li><a href="#links">LINKS</a></li>
<li><a href="#latest-changes">LATEST CHANGES</a></li>
</ul>
<hr>
<h2 id="description">DESCRIPTION</h2>
<p>fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more.</p>
<hr>
Expand Down Expand Up @@ -275,12 +289,6 @@ <h2 id="links">LINKS</h2>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p>v2021.11.22-beta (202111220)</p>
<ul>
<li><code>-t|--test-prefixes</code>: test internal storage prefixes (views) and automatically update the config.</li>
<li>Changed the priorities of emulated storage views to better accommodate Android 11+.</li>
<li>General optimizations</li>
</ul>
<p>v2021.12.2 (202112020)</p>
<ul>
<li>Enhanced flashable zip generator;</li>
Expand All @@ -292,6 +300,12 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<p>v2021.12.2.1 (202112021)</p>
<ul>
<li>Auto-mount hotfix</li>
</ul>
<p>v2021.12.6 (202112060)</p>
<ul>
<li>Added TOC to readme;</li>
<li>General optimizations;</li>
<li>Improved Android 11+ support.</li>
</ul>

</body>
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# fbind


---
- [DESCRIPTION](#description)
- [LICENSE](#license)
- [DISCLAIMER](#disclaimer)
- [WARNING](#warning)
- [PRE-REQUISITES](#pre-requisites)
- [CONFIG SYNTAX](#config-syntax)
- [CONFIG EXAMPLES](#config-examples)
- [TERMINAL COMMANDS](#terminal-commands)
- [NOTES](#notes)
- [LINKS](#links)
- [LATEST CHANGES](#latest-changes)


---
## DESCRIPTION

Expand Down Expand Up @@ -283,11 +297,6 @@ If `/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr
---
## LATEST CHANGES

v2021.11.22-beta (202111220)
- `-t|--test-prefixes`: test internal storage prefixes (views) and automatically update the config.
- Changed the priorities of emulated storage views to better accommodate Android 11+.
- General optimizations

v2021.12.2 (202112020)
- Enhanced flashable zip generator;
- Implemented `losetup` wrapper for greater compatibility;
Expand All @@ -297,3 +306,8 @@ v2021.12.2 (202112020)

v2021.12.2.1 (202112021)
- Auto-mount hotfix

v2021.12.6 (202112060)
- Added TOC to readme;
- General optimizations;
- Improved Android 11+ support.
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=vr25.fbind
name=fbind
version=v2021.12.2.1
versionCode=202112021
version=v2021.12.6
versionCode=202112060
author=VR25 @ xda-developers
description=fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more.
42 changes: 25 additions & 17 deletions system/bin/fbind
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ apply_config() {
grep -q '^extsd_path ' $config || default_extsd

# storage paths fallbacks
for i in $prefix /mnt/runtime/write /mnt/user/0; do
for i in $prefix /mnt/user/0 /mnt/runtime/write; do
is_mounted $i/emulated && prefix=$i && break || prefix=
done
[ -n "$prefix" ] && intsd=$prefix/emulated/0 || intsd=/data/media/0
Expand All @@ -44,6 +44,7 @@ apply_config() {


bind_mount() {
local i=
if ! is_mounted "$2"; then
if $interactiveMode; then
echo
Expand All @@ -52,26 +53,33 @@ bind_mount() {
wait_storage "$@" || return 1
fi
mkdir -p "$1" "$2"
if which bindfs >/dev/null; then
su -Mc bindfs -o nosuid,nodev,noexec,noatime,nonempty -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 \""$1"\" \""$2"\" || {
echo "(i) Trying \"mount -o bind\"..."
mount -o bind \""$1"\" \""$2"\"
}
else
mount -o bind \""$1"\" \""$2"\"
fi
for i in 1 2; do
if which bindfs >/dev/null; then
su -Mc bindfs -o nosuid,nodev,noexec,noatime,nonempty -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 \""$1"\" \""$2"\" || {
echo "(i) Trying \"mount -o bind\"..."
mount -o bind \""$1"\" \""$2"\"
}
else
mount -o bind \""$1"\" \""$2"\"
fi
if [ "$prefix" = /mnt/user/0 ] && is_mounted /mnt/runtime/write/emulated; then
set -- "$1" "$(echo "$2" | sed "s|$prefix|/mnt/user/0|")"
is_mounted "$2" && break
fi
done
if is_mounted "$2"; then
[ -z "$3" ] && rm -rf "$1/Android" 2>/dev/null
[ -z "$3" ] && rm -rf "$1/Android"
else
rmdir "$2" 2>/dev/null
fi
rmdir "$2"
fi 2>/dev/null
fi
}


bind_mount_wrapper() {

$interactiveMode && echo "Bind-mounting..."

# $extobb <--> $obb
Expand Down Expand Up @@ -533,7 +541,7 @@ troubleshooting() {

unmount() {
local line=
local pattern="$(echo "$1" | sed "s|$prefix||")"
local pattern="$(echo "$1" | sed -E "s#$prefix|/mnt/runtime/write|/mnt/user/0##")"
/system/bin/mount | grep "$pattern type " >/dev/null 2>&1 && {
echo "<...${pattern#/}>"
/system/bin/mount | grep "$pattern type " | sed -E -e 's|^.* on /|/|' -e "s|($pattern) type .*|\1|" | \
Expand Down Expand Up @@ -767,7 +775,7 @@ interactiveMode=true
dataDir=/data/adb/vr25/fbind-data
config=$dataDir/config.txt
: ${prefix:=$(sed -n 's/^prefix=//p' $config 2>/dev/null)}
: ${prefix:=/mnt/runtime/write}
: ${prefix:=/mnt/user/0}
intsd=$prefix/emulated/0
obb=$intsd/Android/obb

Expand Down Expand Up @@ -806,7 +814,7 @@ $service || apply_config # & handle LUKS/2
case $1 in

-a|--auto-mount) toggle_auto_mount;;
-b|--bind-mount) bind_mount "$2" "$3" > /dev/null;;
-b|--bind-mount) bind_mount "$2" "$3";;
-c|--config) shift; edit $config "$@";;
-C|--cryptsetup) shift; cryptsetup "$@";;
-f|--fuse) force_fuse;;
Expand Down

0 comments on commit 27aff0a

Please sign in to comment.