Skip to content

Commit

Permalink
Use fuse umount on Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
  • Loading branch information
anestisb committed Aug 11, 2018
1 parent d4866ad commit 064314a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions execute-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -u # fail on undefined variable

readonly SCRIPTS_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
readonly TMP_WORK_DIR=$(mktemp -d /tmp/android_prepare_vendor.XXXXXX) || exit 1
declare -a SYS_TOOLS=("mkdir" "dirname" "wget" "mount" "umount" "shasum")
declare -a SYS_TOOLS=("mkdir" "dirname" "wget" "mount" "shasum")
readonly HOST_OS="$(uname -s)"

# Realpath implementation in bash
Expand Down Expand Up @@ -108,7 +108,7 @@ unmount_raw_image() {
local mount_point="$1"

if [[ -d "$mount_point" && "$USE_DEBUGFS" = false ]]; then
umount "$mount_point" || {
$_UMOUNT "$mount_point" || {
echo "[-] '$mount_point' unmount failed"
exit 1
}
Expand Down Expand Up @@ -316,6 +316,17 @@ JAVA_FOUND=false
check_bash_version
check_compatible_system

# Platform specific commands
if isDarwin; then
SYS_TOOLS+=("umount")
_UMOUNT=umount
else
# For Linux use debugfs
SYS_TOOLS+=("fusermount")
_UMOUNT="fusermount -u"
fi


# Check that system tools exist
for i in "${SYS_TOOLS[@]}"
do
Expand Down

0 comments on commit 064314a

Please sign in to comment.