Skip to content

Commit

Permalink
add new mounting script
Browse files Browse the repository at this point in the history
  • Loading branch information
master-hax committed Oct 29, 2024
1 parent 22f3ec1 commit bc68575
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DEVICE_TEMP_DIRECTORY := /data/local/tmp

ALL_SCRIPTS := \
scripts/mount_ext4.sh \
scripts/mount_folder.sh \
scripts/unmount.sh \
scripts/find_device.sh \
scripts/show_devices.sh \
Expand Down
14 changes: 14 additions & 0 deletions scripts/mount_folder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -ex

################################################################################
# Description: bind mounts the specified directory to /the_binding in internal storage
# Author: Vivek Revankar <vivek@master-hax.com>
# Usage: ./mount_folder.sh <DIRECTORY_PATH>
################################################################################

if [ "$(readlink /proc/self/ns/mnt)" != "$(readlink /proc/1/ns/mnt)" ]; then
echo "not running in global mount namespace, try elevating first"
exit 1
fi

mount -t sdcardfs -o nosuid,nodev,noexec,noatime,gid=9997 "$1" /mnt/runtime/write/emulated/0/the_binding

0 comments on commit bc68575

Please sign in to comment.