Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to usbmount to allow for mountpoint specification #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions package/usbmount/usbmount-mountpoint.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- old/usbmount 2011-08-08 08:57:49.000000000 -0700
+++ new/usbmount 2013-03-05 10:58:14.873144016 -0800
@@ -138,6 +138,23 @@ if [ "$1" = add ]; then
log info "executing command: mount -t$fstype ${options:+-o$options} $DEVNAME $mountpoint"
mount "-t$fstype" "${options:+-o$options}" "$DEVNAME" "$mountpoint"

+ # Move mountpoint to desired location
+ if [ -f $mountpoint"/.mountpoint" ]; then
+ # Read desired directory name from .mountpoint file on device
+ destination=$(head -n 1 $mountpoint"/.mountpoint")
+ if [ ${#destination} -gt 0 ]; then
+ if [ ! -d "/media/$destination" ]; then
+ mkdir /media/$destination
+ fi
+ # Make sure something isn't already mounted here
+ if ! fgrep -qs " /media/$destination " /proc/mounts ; then
+ # move mounted device to desired location
+ mount --move $mountpoint /media/$destination
+ mountpoint="/media/$destination"
+ fi
+ fi
+ fi
+
# Determine vendor and model.
vendor=
if [ -r "/sys$DEVPATH/device/vendor" ]; then