From 6f1c6ae6e5000cf3439150afb4a12b6ff8ae55ff Mon Sep 17 00:00:00 2001 From: Vivek Revankar Date: Thu, 31 Oct 2024 00:33:59 -0700 Subject: [PATCH] new script who dis --- Makefile | 8 +++---- scripts/mount_folder.sh | 14 ------------- scripts/remount_vfat.sh | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) delete mode 100644 scripts/mount_folder.sh create mode 100644 scripts/remount_vfat.sh diff --git a/Makefile b/Makefile index 254f328..a666185 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ DEVICE_TEMP_DIRECTORY := /data/local/tmp ALL_SCRIPTS := \ scripts/mount_ext4.sh \ -scripts/mount_folder.sh \ +scripts/remount_vfat.sh \ scripts/unmount.sh \ scripts/find_device.sh \ scripts/show_devices.sh \ @@ -30,10 +30,10 @@ mobile-install: pixel-backup-gang-$(PBG_VERSION).tar.gz # copy the tarball containing scripts $(HOST_ADB_COMMAND) push ./pixel-backup-gang-$(PBG_VERSION).tar.gz $(DEVICE_TEMP_DIRECTORY) # extract the scripts - $(HOST_ADB_COMMAND) shell /sbin/su --command 'tar -xvf $(DEVICE_TEMP_DIRECTORY)/pixel-backup-gang-$(PBG_VERSION).tar.gz -C $(DEVICE_INSTALL_DIRECTORY)' + $(HOST_ADB_COMMAND) shell su --command 'tar -xvf $(DEVICE_TEMP_DIRECTORY)/pixel-backup-gang-$(PBG_VERSION).tar.gz -C $(DEVICE_INSTALL_DIRECTORY)' # make the scripts executable - $(HOST_ADB_COMMAND) shell /sbin/su --command 'chmod +x $(DEVICE_INSTALL_DIRECTORY)/pixel-backup-gang-$(PBG_VERSION)/*.sh' - # done, installed scripts to $(DEVICE_INSTALL_DIRECTORY)/pixel-backup-gang-$(PBG_VERSION) + $(HOST_ADB_COMMAND) shell su --command 'chmod +x $(DEVICE_INSTALL_DIRECTORY)/pixel-backup-gang/*.sh' + # done, installed scripts to $(DEVICE_INSTALL_DIRECTORY)/pixel-backup-gang .PHONY: clean clean: diff --git a/scripts/mount_folder.sh b/scripts/mount_folder.sh deleted file mode 100644 index 46d8748..0000000 --- a/scripts/mount_folder.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -ex - -################################################################################ -# Description: bind mounts the specified directory to /the_binding in internal storage -# Author: Vivek Revankar -# Usage: ./mount_folder.sh -################################################################################ - -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 diff --git a/scripts/remount_vfat.sh b/scripts/remount_vfat.sh new file mode 100644 index 0000000..a962714 --- /dev/null +++ b/scripts/remount_vfat.sh @@ -0,0 +1,46 @@ +#!/bin/sh -e + +################################################################################ +# Description: remounts /the_binding in the specified mounted vfat folder to the internal storage +# Author: Vivek Revankar +# Usage: ./remount_vfat.sh +# Example: ./remount_vfat.sh /mnt/media_rw/2IDK-11F4 +################################################################################ + + +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 + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 /mnt/media_rw/