diff --git a/Makefile b/Makefile index 722e776..a666185 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ DEVICE_TEMP_DIRECTORY := /data/local/tmp ALL_SCRIPTS := \ scripts/mount_ext4.sh \ +scripts/remount_vfat.sh \ scripts/unmount.sh \ scripts/find_device.sh \ scripts/show_devices.sh \ @@ -29,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/remount_vfat.sh b/scripts/remount_vfat.sh new file mode 100644 index 0000000..42927ab --- /dev/null +++ b/scripts/remount_vfat.sh @@ -0,0 +1,45 @@ +#!/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/