1From 19cb4ac0f2342331ff57489cda565b3d36463fee Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Fri, 17 Jun 2022 15:20:58 +0800
4Subject: [PATCH 4/5] usbmount: Allow unmounting other mountpoints
5
6We're allowed to mount devices(in fstab) on other mountpoints.
7
8Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
9---
10 usbmount | 5 ++---
11 1 file changed, 2 insertions(+), 3 deletions(-)
12
13diff --git a/usbmount b/usbmount
14index c09a865..d9a1f0c 100755
15--- a/usbmount
16+++ b/usbmount
17@@ -174,10 +174,9 @@ elif [ "$1" = remove ]; then
18     # Test if it is mounted.
19     while read device mountpoint fstype remainder; do
20 	if [ "$DEVNAME" = "$device" ]; then
21-	    # If the mountpoint and filesystem type are maintained by
22+	    # If the filesystem type is maintained by
23 	    # this script, unmount the filesystem.
24-	    if in_list "$mountpoint" "$MOUNTPOINTS" &&
25-		in_list "$fstype" "$FILESYSTEMS"; then
26+	    if in_list "$fstype" "$FILESYSTEMS"; then
27 		log info "executing command: umount -l $mountpoint"
28 		umount -l "$mountpoint"
29
30--
312.20.1
32
33