[Usbmount-commit] r41 - / tags trunk usbmount usbmount/tags usbmount/trunk usbmount/trunk/debian www

rbrito-guest at alioth.debian.org rbrito-guest at alioth.debian.org
Sun Oct 19 08:46:37 UTC 2008


Author: rbrito-guest
Date: 2008-10-19 08:46:37 +0000 (Sun, 19 Oct 2008)
New Revision: 41

Added:
   usbmount/
   usbmount/branches/
   usbmount/tags/
   usbmount/trunk/
   usbmount/trunk/00_create_model_symlink
   usbmount/trunk/00_remove_model_symlink
   usbmount/trunk/README
   usbmount/trunk/debian/
   usbmount/trunk/usbmount
   usbmount/trunk/usbmount.conf
   usbmount/trunk/usbmount.rules
   www/
Removed:
   tags/usbmount/
   trunk/usbmount/
   trunk/www/
   usbmount/00_create_model_symlink
   usbmount/00_remove_model_symlink
   usbmount/README
   usbmount/debian/
   usbmount/usbmount
   usbmount/usbmount.conf
   usbmount/usbmount.rules
Log:
Reformulated the hierarchy of the project.


Copied: usbmount (from rev 40, trunk/usbmount)


Property changes on: usbmount
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: usbmount/00_create_model_symlink
===================================================================
--- trunk/usbmount/00_create_model_symlink	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/00_create_model_symlink	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,40 +0,0 @@
-#!/bin/sh
-# This script creates the model name symlink in /var/run/usbmount.
-# Copyright (C) 2005 Martin Dickopp
-#
-# This file is free software; the copyright holder gives unlimited
-# permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-#
-set -e
-
-# Replace spaces with underscores, remove special characters in vendor
-# and model name.
-UM_VENDOR=`echo "$UM_VENDOR" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`
-UM_MODEL=`echo "$UM_MODEL" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`
-
-# Exit if both vendor and model name are empty.
-test -n "$UM_VENDOR" || test -n "$UM_MODEL" || exit 0
-
-# Build symlink name.
-if test -n "$UM_VENDOR" && test -n "$UM_MODEL"; then
-    name="${UM_VENDOR}_$UM_MODEL"
-else
-    name="$UM_VENDOR$UM_MODEL"
-fi
-
-# Append partition number, if any, to the symlink name.
-partition=`echo "$UM_DEVICE" | sed 's/^.*[^0123456789]\([0123456789]*\)/\1/'`
-if test -n "$partition"; then
-    name="${name}_$partition"
-fi
-
-# If the symlink does not yet exist, create it.
-test -e "/var/run/usbmount/$name" || ln -sf "$UM_MOUNTPOINT" "/var/run/usbmount/$name"
-
-exit 0

Deleted: usbmount/00_remove_model_symlink
===================================================================
--- trunk/usbmount/00_remove_model_symlink	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/00_remove_model_symlink	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,23 +0,0 @@
-#!/bin/sh
-# This script removes the model name symlink in /var/run/usbmount.
-# Copyright (C) 2005 Martin Dickopp
-#
-# This file is free software; the copyright holder gives unlimited
-# permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-#
-set -e
-
-ls /var/run/usbmount | while read name; do
-    if test "`readlink \"/var/run/usbmount/$name\" || :`" = "$UM_MOUNTPOINT"; then
-	rm -f "/var/run/usbmount/$name"
-	break
-    fi
-done
-
-exit 0

Deleted: usbmount/README
===================================================================
--- trunk/usbmount/README	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/README	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,67 +0,0 @@
-USBmount
-========
-
-The USBmount package automatically mounts USB mass storage devices
-(typically USB pens) when they are plugged in, and unmounts them when
-they are removed. The mountpoints (/media/usb[0-7] by default),
-filesystem types to consider, and mount options are configurable. When
-multiple devices are plugged in, the first available mountpoint is
-automatically selected. If the device provides a model name, a symbolic
-link /var/run/usbmount/MODELNAME pointing to the mountpoint is auto-
-matically created.
-
-The script that does the (un)mounting is called by the udev daemon.
-Therefore, USBmount requires a 2.6 (or newer) kernel.
-
-USBmount is intended as a lightweight solution which is independent of a
-desktop environment. Users which would like an icon to appear when an
-USB device is plugged in should use the pmount and hal packages instead.
-
-The comments in the configuration file /etc/usbmount/usbmount.conf
-describe how to configure the package.
-
-
-Vfat Filesystems
-----------------
-
-Filesystems of type vfat are not considered by default, despite being
-popular for many USB devices, because the Linux kernel does not yet
-fully implement sync-mounting for this filesystem type. This means that
-you risk losing data or even corrupting the filesystem if you remove the
-medium before all data has been written to it. If you include vfat in
-the FILESYSTEMS configuration variable, you *MUST* run the 'sync'
-command before removing the device.
-
-A useful configuration for vfat filesystems is to include a string like
--fstype=vfat,gid=floppy,dmask=0007,fmask=0117 in the FS_MOUNTOPTIONS
-variable. These mount options have the effect that members of the floppy
-group can read from and write to the medium, but nobody else can access
-it.
-
-
-Hook Scripts
-------------
-
-After a device or partition has been mounted, the command 'run-parts
-/etc/usbmount/mount.d' is executed. This runs all scripts in
-/etc/usbmount/mount.d which adhere to a certain naming convention; see
-the run-parts manual page for details.
-
-The following environment variables are available to the scripts (in
-addition to those set in /etc/usbmount/usbmount.conf and by the hotplug
-and udev systems):
-
-UM_DEVICE       - filename of the device node
-UM_MOUNTPOINT   - mointpoint
-UM_FILESYSTEM   - filesystem type
-UM_MOUNTOPTIONS - mount options that have been passed to the mount command
-UM_VENDOR       - vendor of the device (empty if unknown)
-UM_MODEL        - model name of the device (empty if unknown)
-
-Likewise, the command 'run-parts /etc/usbmount/umount.d' is executed
-after a device or partition has been unmounted. The scripts can make use
-of the environment variables UM_DEVICE, UM_MOUNTPOINT and UM_FILESYSTEM.
-Note that vendor and model name are no longer easily available when the
-device has been removed. If you need this information in an unmount hook
-script, write it to a file in a mount hook script and read it back in
-the unmount hook script.

Copied: usbmount/tags (from rev 40, tags/usbmount)


Property changes on: usbmount/tags
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/00_create_model_symlink (from rev 40, trunk/usbmount/00_create_model_symlink)
===================================================================
--- usbmount/trunk/00_create_model_symlink	                        (rev 0)
+++ usbmount/trunk/00_create_model_symlink	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,40 @@
+#!/bin/sh
+# This script creates the model name symlink in /var/run/usbmount.
+# Copyright (C) 2005 Martin Dickopp
+#
+# This file is free software; the copyright holder gives unlimited
+# permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+#
+set -e
+
+# Replace spaces with underscores, remove special characters in vendor
+# and model name.
+UM_VENDOR=`echo "$UM_VENDOR" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`
+UM_MODEL=`echo "$UM_MODEL" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`
+
+# Exit if both vendor and model name are empty.
+test -n "$UM_VENDOR" || test -n "$UM_MODEL" || exit 0
+
+# Build symlink name.
+if test -n "$UM_VENDOR" && test -n "$UM_MODEL"; then
+    name="${UM_VENDOR}_$UM_MODEL"
+else
+    name="$UM_VENDOR$UM_MODEL"
+fi
+
+# Append partition number, if any, to the symlink name.
+partition=`echo "$UM_DEVICE" | sed 's/^.*[^0123456789]\([0123456789]*\)/\1/'`
+if test -n "$partition"; then
+    name="${name}_$partition"
+fi
+
+# If the symlink does not yet exist, create it.
+test -e "/var/run/usbmount/$name" || ln -sf "$UM_MOUNTPOINT" "/var/run/usbmount/$name"
+
+exit 0


Property changes on: usbmount/trunk/00_create_model_symlink
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/00_remove_model_symlink (from rev 40, trunk/usbmount/00_remove_model_symlink)
===================================================================
--- usbmount/trunk/00_remove_model_symlink	                        (rev 0)
+++ usbmount/trunk/00_remove_model_symlink	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,23 @@
+#!/bin/sh
+# This script removes the model name symlink in /var/run/usbmount.
+# Copyright (C) 2005 Martin Dickopp
+#
+# This file is free software; the copyright holder gives unlimited
+# permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+#
+set -e
+
+ls /var/run/usbmount | while read name; do
+    if test "`readlink \"/var/run/usbmount/$name\" || :`" = "$UM_MOUNTPOINT"; then
+	rm -f "/var/run/usbmount/$name"
+	break
+    fi
+done
+
+exit 0


Property changes on: usbmount/trunk/00_remove_model_symlink
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/README (from rev 40, trunk/usbmount/README)
===================================================================
--- usbmount/trunk/README	                        (rev 0)
+++ usbmount/trunk/README	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,67 @@
+USBmount
+========
+
+The USBmount package automatically mounts USB mass storage devices
+(typically USB pens) when they are plugged in, and unmounts them when
+they are removed. The mountpoints (/media/usb[0-7] by default),
+filesystem types to consider, and mount options are configurable. When
+multiple devices are plugged in, the first available mountpoint is
+automatically selected. If the device provides a model name, a symbolic
+link /var/run/usbmount/MODELNAME pointing to the mountpoint is auto-
+matically created.
+
+The script that does the (un)mounting is called by the udev daemon.
+Therefore, USBmount requires a 2.6 (or newer) kernel.
+
+USBmount is intended as a lightweight solution which is independent of a
+desktop environment. Users which would like an icon to appear when an
+USB device is plugged in should use the pmount and hal packages instead.
+
+The comments in the configuration file /etc/usbmount/usbmount.conf
+describe how to configure the package.
+
+
+Vfat Filesystems
+----------------
+
+Filesystems of type vfat are not considered by default, despite being
+popular for many USB devices, because the Linux kernel does not yet
+fully implement sync-mounting for this filesystem type. This means that
+you risk losing data or even corrupting the filesystem if you remove the
+medium before all data has been written to it. If you include vfat in
+the FILESYSTEMS configuration variable, you *MUST* run the 'sync'
+command before removing the device.
+
+A useful configuration for vfat filesystems is to include a string like
+-fstype=vfat,gid=floppy,dmask=0007,fmask=0117 in the FS_MOUNTOPTIONS
+variable. These mount options have the effect that members of the floppy
+group can read from and write to the medium, but nobody else can access
+it.
+
+
+Hook Scripts
+------------
+
+After a device or partition has been mounted, the command 'run-parts
+/etc/usbmount/mount.d' is executed. This runs all scripts in
+/etc/usbmount/mount.d which adhere to a certain naming convention; see
+the run-parts manual page for details.
+
+The following environment variables are available to the scripts (in
+addition to those set in /etc/usbmount/usbmount.conf and by the hotplug
+and udev systems):
+
+UM_DEVICE       - filename of the device node
+UM_MOUNTPOINT   - mointpoint
+UM_FILESYSTEM   - filesystem type
+UM_MOUNTOPTIONS - mount options that have been passed to the mount command
+UM_VENDOR       - vendor of the device (empty if unknown)
+UM_MODEL        - model name of the device (empty if unknown)
+
+Likewise, the command 'run-parts /etc/usbmount/umount.d' is executed
+after a device or partition has been unmounted. The scripts can make use
+of the environment variables UM_DEVICE, UM_MOUNTPOINT and UM_FILESYSTEM.
+Note that vendor and model name are no longer easily available when the
+device has been removed. If you need this information in an unmount hook
+script, write it to a file in a mount hook script and read it back in
+the unmount hook script.


Property changes on: usbmount/trunk/README
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/debian (from rev 40, trunk/usbmount/debian)


Property changes on: usbmount/trunk/debian
___________________________________________________________________
Name: svn:ignore
   + files
usbmount

Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/usbmount (from rev 40, trunk/usbmount/usbmount)
===================================================================
--- usbmount/trunk/usbmount	                        (rev 0)
+++ usbmount/trunk/usbmount	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,193 @@
+#!/bin/sh
+# This script mounts USB mass storage devices when they are plugged in
+# and unmounts them when they are removed.
+# Copyright (C) 2004, 2005 Martin Dickopp
+#
+# This file is free software; the copyright holder gives unlimited
+# permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+#
+set -e
+exec > /dev/null 2>&1
+
+
+# Log a string via the syslog facility.
+log()
+{
+    if test $1 != debug || expr "$VERBOSE" : "[yY]" > /dev/null; then
+	logger -p user.$1 -t "usbmount[$$]" -- "$2"
+    fi
+}
+
+
+# Test if the first parameter is in the list given by the second
+# parameter.
+in_list()
+{
+    for v in $2; do
+	test "$1" != "$v" || return 0
+    done
+    return 1
+}
+
+
+# Test if /lib/udev/vol_id is executable.
+test -x /lib/udev/vol_id || { log err "cannnot execute /lib/udev/vol_id"; exit 1; }
+
+# Default values for configuration variables.
+MOUNTPOINTS=""
+FILESYSTEMS=""
+MOUNTOPTIONS=""
+FS_MOUNTOPTIONS=""
+VERBOSE="no"
+
+# Read configuration file.
+if test -r /etc/usbmount/usbmount.conf; then
+    . /etc/usbmount/usbmount.conf
+fi
+
+
+umask 022
+
+if test "$1" = add; then
+
+    # Acquire lock.
+    log debug "trying to acquire lock /var/run/usbmount/.mount.lock"
+    lockfile-create --retry 3 /var/run/usbmount/.mount || \
+	{ log err "cannot acquire lock /var/run/usbmount/.mount.lock"; exit 1; }
+    trap '( lockfile-remove /var/run/usbmount/.mount )' 0
+    log debug "acquired lock /var/run/usbmount/.mount.lock"
+
+    # Try to read from the device.  Some devices need a few seconds
+    # initialization time before they can be accessed.  Give up after
+    # 20 seconds.  Thanks to Peter Stelmachovic for his help with
+    # debugging this.
+    log debug "testing whether $DEVNAME is readable"
+    read_success=no
+    for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
+	if dd if="$DEVNAME" of=/dev/null bs=512 count=1; then
+	    read_success=yes
+	    break
+	fi
+	log debug "attempt $t to read from $DEVNAME failed"
+	sleep 1
+    done
+    if test "$read_success" != yes; then
+	log err "cannot read from $DEVNAME"
+	exit 1
+    fi
+
+    # Test if the device contains a filesystem.  If it doesn't, no
+    # further action is required, but calling vol_id has the side effect
+    # that the partition table is read and partition devices are created.
+    if /lib/udev/vol_id "$DEVNAME" | egrep -q '^ID_FS_USAGE=(filesystem|disklabel)$'; then
+	log debug "$DEVNAME contains a filesystem or disklabel"
+
+	fstype="`/lib/udev/vol_id -t \"$DEVNAME\"`"
+	log debug "$DEVNAME contains filesystem type $fstype"
+
+	# Test if the filesystem type is in the list of filesystem
+	# types to mount.
+	if in_list "$fstype" "$FILESYSTEMS"; then
+
+	    # Search an available mountpoint.
+	    for v in $MOUNTPOINTS; do
+		if test -d "$v" \
+		    && ! grep -q "^[^ ][^ ]*  *$v " /proc/mounts; then
+		    mountpoint="$v"
+		    log debug "mountpoint $mountpoint is available for $DEVNAME"
+		    break
+		fi
+	    done
+	    if test -n "$mountpoint"; then
+		# Determine mount options.
+		options=
+		for v in $FS_MOUNTOPTIONS; do
+		    if expr "$v" : "-fstype=$fstype,."; then
+			options="`echo \"$v\" | sed 's/^[^,]*,//'`"
+			break
+		    fi
+		done
+		if test -n "$MOUNTOPTIONS"; then
+		    options="$MOUNTOPTIONS${options:+,$options}"
+		fi
+
+		# Mount the filesystem.
+		log info "executing command: mount -t$fstype ${options:+-o$options} $DEVNAME $mountpoint"
+		mount "-t$fstype" "${options:+-o$options}" "$DEVNAME" "$mountpoint"
+
+		# Determine vendor and model.
+		vendor=
+		if test -r "/sys$DEVPATH/device/vendor"; then
+		    vendor="`cat \"/sys$DEVPATH/device/vendor\"`"
+		elif test -r "/sys$DEVPATH/../device/vendor"; then
+		    vendor="`cat \"/sys$DEVPATH/../device/vendor\"`"
+		elif test -r "/sys$DEVPATH/device/../manufacturer"; then
+		    vendor="`cat \"/sys$DEVPATH/device/../manufacturer\"`"
+		elif test -r "/sys$DEVPATH/../device/../manufacturer"; then
+		    vendor="`cat \"/sys$DEVPATH/../device/../manufacturer\"`"
+		fi
+		vendor="`echo \"$vendor\" | sed 's/^ *//; s/ *$//'`"
+		model=
+		if test -r "/sys$DEVPATH/device/model"; then
+		    model="`cat \"/sys$DEVPATH/device/model\"`"
+		elif test -r "/sys$DEVPATH/../device/model"; then
+		    model="`cat \"/sys$DEVPATH/../device/model\"`"
+		elif test -r "/sys$DEVPATH/device/../product"; then
+		    model="`cat \"/sys$DEVPATH/device/../product\"`"
+		elif test -r "/sys$DEVPATH/../device/../product"; then
+		    model="`cat \"/sys$DEVPATH/../device/../product\"`"
+		fi
+		model="`echo \"$model\" | sed 's/^ *//; s/ *$//'`"
+
+		# Run hook scripts; ignore errors.
+		export UM_DEVICE="$DEVNAME"
+		export UM_MOUNTPOINT="$mountpoint"
+		export UM_FILESYSTEM="$fstype"
+		export UM_MOUNTOPTIONS="$options"
+		export UM_VENDOR="$vendor"
+		export UM_MODEL="$model"
+		log info "executing command: run-parts /etc/usbmount/mount.d"
+		run-parts /etc/usbmount/mount.d || :
+	    else
+		# No suitable mount point found.
+		log warning "no mountpoint found for $DEVNAME"
+		exit 1
+	    fi
+	fi
+    else
+	log debug "$DEVNAME does not contain a filesystem or disklabel"
+    fi
+
+elif test "$1" = remove; then
+
+    # A block or partition device has been removed.
+    # Test if it is mounted.
+    while read device mountpoint fstype remainder; do
+	if test "$DEVNAME" = "$device"; then
+	    # If the mountpoint and filesystem type are maintained by
+	    # this script, unmount the filesystem.
+	    if in_list "$mountpoint" "$MOUNTPOINTS" \
+		&& in_list "$fstype" "$FILESYSTEMS"; then
+		log info "executing command: umount -l $mountpoint"
+		umount -l "$mountpoint"
+
+		# Run hook scripts; ignore errors.
+		export UM_DEVICE="$DEVNAME"
+		export UM_MOUNTPOINT="$mountpoint"
+		export UM_FILESYSTEM="$fstype"
+		log info "executing command: run-parts /etc/usbmount/umount.d"
+		run-parts /etc/usbmount/umount.d || :
+	    fi
+	    break
+	fi
+    done < /proc/mounts
+
+fi
+
+exit 0


Property changes on: usbmount/trunk/usbmount
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/usbmount.conf (from rev 40, trunk/usbmount/usbmount.conf)
===================================================================
--- usbmount/trunk/usbmount.conf	                        (rev 0)
+++ usbmount/trunk/usbmount.conf	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,37 @@
+# Configuration file for the usbmount package, which mounts USB mass
+# storage devices when they are plugged in and unmounts them when they
+# are removed.
+
+# Mountpoints: These directories are eligible as mointpoints for USB
+# mass storage devices.  A newly plugged in device is mounted on the
+# first directory in this list that exists and on which nothing is
+# mounted yet.
+MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3
+             /media/usb4 /media/usb5 /media/usb6 /media/usb7"
+
+# Filesystem types: USB mass storage devices are only mounted if they
+# contain a filesystem type which is in this list.
+#############################################################################
+# WARNING!  The vfat filesystem does not yet fully implement sync-mounting. #
+# If you include "vfat" in the list of filesystem types, you *MUST* make    #
+# sure all data is written to the medium before you remove it (e.g. run the #
+# "sync" command in a terminal window).  Otherwise, you *WILL* lose data!   #
+#############################################################################
+FILESYSTEMS="ext2 ext3"
+
+# Mount options: Options passed to the mount command with the -o flag.
+# WARNING!  Removing "sync" from the options is a very bad idea and
+# might result in severe data loss.
+MOUNTOPTIONS="sync,noexec,nodev,noatime"
+
+# Filesystem type specific mount options: This variable contains a space sepa-
+# rated list of strings, each of which has the form "-fstype=TYPE,OPTIONS".
+# If a filesystem with a type listed here is mounted, the corresponding
+# options are appended to those specificed in the MOUNTOPTIONS variable.
+# For example, "-fstype=vfat,gid=floppy,dmask=0007,fmask=0117" would add the
+# options "gid=floppy,dmask=0007,fmask=0117" when a vfat filesystem is mounted.
+FS_MOUNTOPTIONS=""
+
+# If set to "yes", more information will be logged via the syslog
+# facility.
+VERBOSE="no"


Property changes on: usbmount/trunk/usbmount.conf
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: usbmount/trunk/usbmount.rules (from rev 40, trunk/usbmount/usbmount.rules)
===================================================================
--- usbmount/trunk/usbmount.rules	                        (rev 0)
+++ usbmount/trunk/usbmount.rules	2008-10-19 08:46:37 UTC (rev 41)
@@ -0,0 +1,6 @@
+# Rules for USBmount
+
+KERNEL=="sd*", BUS=="usb", ACTION=="add",    RUN+="/usr/share/usbmount/usbmount add"
+KERNEL=="ub*", BUS=="usb", ACTION=="add",    RUN+="/usr/share/usbmount/usbmount add"
+KERNEL=="sd*",             ACTION=="remove", RUN+="/usr/share/usbmount/usbmount remove"
+KERNEL=="ub*",             ACTION=="remove", RUN+="/usr/share/usbmount/usbmount remove"


Property changes on: usbmount/trunk/usbmount.rules
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: usbmount/usbmount
===================================================================
--- trunk/usbmount/usbmount	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/usbmount	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,193 +0,0 @@
-#!/bin/sh
-# This script mounts USB mass storage devices when they are plugged in
-# and unmounts them when they are removed.
-# Copyright (C) 2004, 2005 Martin Dickopp
-#
-# This file is free software; the copyright holder gives unlimited
-# permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-#
-set -e
-exec > /dev/null 2>&1
-
-
-# Log a string via the syslog facility.
-log()
-{
-    if test $1 != debug || expr "$VERBOSE" : "[yY]" > /dev/null; then
-	logger -p user.$1 -t "usbmount[$$]" -- "$2"
-    fi
-}
-
-
-# Test if the first parameter is in the list given by the second
-# parameter.
-in_list()
-{
-    for v in $2; do
-	test "$1" != "$v" || return 0
-    done
-    return 1
-}
-
-
-# Test if /lib/udev/vol_id is executable.
-test -x /lib/udev/vol_id || { log err "cannnot execute /lib/udev/vol_id"; exit 1; }
-
-# Default values for configuration variables.
-MOUNTPOINTS=""
-FILESYSTEMS=""
-MOUNTOPTIONS=""
-FS_MOUNTOPTIONS=""
-VERBOSE="no"
-
-# Read configuration file.
-if test -r /etc/usbmount/usbmount.conf; then
-    . /etc/usbmount/usbmount.conf
-fi
-
-
-umask 022
-
-if test "$1" = add; then
-
-    # Acquire lock.
-    log debug "trying to acquire lock /var/run/usbmount/.mount.lock"
-    lockfile-create --retry 3 /var/run/usbmount/.mount || \
-	{ log err "cannot acquire lock /var/run/usbmount/.mount.lock"; exit 1; }
-    trap '( lockfile-remove /var/run/usbmount/.mount )' 0
-    log debug "acquired lock /var/run/usbmount/.mount.lock"
-
-    # Try to read from the device.  Some devices need a few seconds
-    # initialization time before they can be accessed.  Give up after
-    # 20 seconds.  Thanks to Peter Stelmachovic for his help with
-    # debugging this.
-    log debug "testing whether $DEVNAME is readable"
-    read_success=no
-    for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do
-	if dd if="$DEVNAME" of=/dev/null bs=512 count=1; then
-	    read_success=yes
-	    break
-	fi
-	log debug "attempt $t to read from $DEVNAME failed"
-	sleep 1
-    done
-    if test "$read_success" != yes; then
-	log err "cannot read from $DEVNAME"
-	exit 1
-    fi
-
-    # Test if the device contains a filesystem.  If it doesn't, no
-    # further action is required, but calling vol_id has the side effect
-    # that the partition table is read and partition devices are created.
-    if /lib/udev/vol_id "$DEVNAME" | egrep -q '^ID_FS_USAGE=(filesystem|disklabel)$'; then
-	log debug "$DEVNAME contains a filesystem or disklabel"
-
-	fstype="`/lib/udev/vol_id -t \"$DEVNAME\"`"
-	log debug "$DEVNAME contains filesystem type $fstype"
-
-	# Test if the filesystem type is in the list of filesystem
-	# types to mount.
-	if in_list "$fstype" "$FILESYSTEMS"; then
-
-	    # Search an available mountpoint.
-	    for v in $MOUNTPOINTS; do
-		if test -d "$v" \
-		    && ! grep -q "^[^ ][^ ]*  *$v " /proc/mounts; then
-		    mountpoint="$v"
-		    log debug "mountpoint $mountpoint is available for $DEVNAME"
-		    break
-		fi
-	    done
-	    if test -n "$mountpoint"; then
-		# Determine mount options.
-		options=
-		for v in $FS_MOUNTOPTIONS; do
-		    if expr "$v" : "-fstype=$fstype,."; then
-			options="`echo \"$v\" | sed 's/^[^,]*,//'`"
-			break
-		    fi
-		done
-		if test -n "$MOUNTOPTIONS"; then
-		    options="$MOUNTOPTIONS${options:+,$options}"
-		fi
-
-		# Mount the filesystem.
-		log info "executing command: mount -t$fstype ${options:+-o$options} $DEVNAME $mountpoint"
-		mount "-t$fstype" "${options:+-o$options}" "$DEVNAME" "$mountpoint"
-
-		# Determine vendor and model.
-		vendor=
-		if test -r "/sys$DEVPATH/device/vendor"; then
-		    vendor="`cat \"/sys$DEVPATH/device/vendor\"`"
-		elif test -r "/sys$DEVPATH/../device/vendor"; then
-		    vendor="`cat \"/sys$DEVPATH/../device/vendor\"`"
-		elif test -r "/sys$DEVPATH/device/../manufacturer"; then
-		    vendor="`cat \"/sys$DEVPATH/device/../manufacturer\"`"
-		elif test -r "/sys$DEVPATH/../device/../manufacturer"; then
-		    vendor="`cat \"/sys$DEVPATH/../device/../manufacturer\"`"
-		fi
-		vendor="`echo \"$vendor\" | sed 's/^ *//; s/ *$//'`"
-		model=
-		if test -r "/sys$DEVPATH/device/model"; then
-		    model="`cat \"/sys$DEVPATH/device/model\"`"
-		elif test -r "/sys$DEVPATH/../device/model"; then
-		    model="`cat \"/sys$DEVPATH/../device/model\"`"
-		elif test -r "/sys$DEVPATH/device/../product"; then
-		    model="`cat \"/sys$DEVPATH/device/../product\"`"
-		elif test -r "/sys$DEVPATH/../device/../product"; then
-		    model="`cat \"/sys$DEVPATH/../device/../product\"`"
-		fi
-		model="`echo \"$model\" | sed 's/^ *//; s/ *$//'`"
-
-		# Run hook scripts; ignore errors.
-		export UM_DEVICE="$DEVNAME"
-		export UM_MOUNTPOINT="$mountpoint"
-		export UM_FILESYSTEM="$fstype"
-		export UM_MOUNTOPTIONS="$options"
-		export UM_VENDOR="$vendor"
-		export UM_MODEL="$model"
-		log info "executing command: run-parts /etc/usbmount/mount.d"
-		run-parts /etc/usbmount/mount.d || :
-	    else
-		# No suitable mount point found.
-		log warning "no mountpoint found for $DEVNAME"
-		exit 1
-	    fi
-	fi
-    else
-	log debug "$DEVNAME does not contain a filesystem or disklabel"
-    fi
-
-elif test "$1" = remove; then
-
-    # A block or partition device has been removed.
-    # Test if it is mounted.
-    while read device mountpoint fstype remainder; do
-	if test "$DEVNAME" = "$device"; then
-	    # If the mountpoint and filesystem type are maintained by
-	    # this script, unmount the filesystem.
-	    if in_list "$mountpoint" "$MOUNTPOINTS" \
-		&& in_list "$fstype" "$FILESYSTEMS"; then
-		log info "executing command: umount -l $mountpoint"
-		umount -l "$mountpoint"
-
-		# Run hook scripts; ignore errors.
-		export UM_DEVICE="$DEVNAME"
-		export UM_MOUNTPOINT="$mountpoint"
-		export UM_FILESYSTEM="$fstype"
-		log info "executing command: run-parts /etc/usbmount/umount.d"
-		run-parts /etc/usbmount/umount.d || :
-	    fi
-	    break
-	fi
-    done < /proc/mounts
-
-fi
-
-exit 0

Deleted: usbmount/usbmount.conf
===================================================================
--- trunk/usbmount/usbmount.conf	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/usbmount.conf	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,37 +0,0 @@
-# Configuration file for the usbmount package, which mounts USB mass
-# storage devices when they are plugged in and unmounts them when they
-# are removed.
-
-# Mountpoints: These directories are eligible as mointpoints for USB
-# mass storage devices.  A newly plugged in device is mounted on the
-# first directory in this list that exists and on which nothing is
-# mounted yet.
-MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3
-             /media/usb4 /media/usb5 /media/usb6 /media/usb7"
-
-# Filesystem types: USB mass storage devices are only mounted if they
-# contain a filesystem type which is in this list.
-#############################################################################
-# WARNING!  The vfat filesystem does not yet fully implement sync-mounting. #
-# If you include "vfat" in the list of filesystem types, you *MUST* make    #
-# sure all data is written to the medium before you remove it (e.g. run the #
-# "sync" command in a terminal window).  Otherwise, you *WILL* lose data!   #
-#############################################################################
-FILESYSTEMS="ext2 ext3"
-
-# Mount options: Options passed to the mount command with the -o flag.
-# WARNING!  Removing "sync" from the options is a very bad idea and
-# might result in severe data loss.
-MOUNTOPTIONS="sync,noexec,nodev,noatime"
-
-# Filesystem type specific mount options: This variable contains a space sepa-
-# rated list of strings, each of which has the form "-fstype=TYPE,OPTIONS".
-# If a filesystem with a type listed here is mounted, the corresponding
-# options are appended to those specificed in the MOUNTOPTIONS variable.
-# For example, "-fstype=vfat,gid=floppy,dmask=0007,fmask=0117" would add the
-# options "gid=floppy,dmask=0007,fmask=0117" when a vfat filesystem is mounted.
-FS_MOUNTOPTIONS=""
-
-# If set to "yes", more information will be logged via the syslog
-# facility.
-VERBOSE="no"

Deleted: usbmount/usbmount.rules
===================================================================
--- trunk/usbmount/usbmount.rules	2008-10-19 08:21:59 UTC (rev 40)
+++ usbmount/usbmount.rules	2008-10-19 08:46:37 UTC (rev 41)
@@ -1,6 +0,0 @@
-# Rules for USBmount
-
-KERNEL=="sd*", BUS=="usb", ACTION=="add",    RUN+="/usr/share/usbmount/usbmount add"
-KERNEL=="ub*", BUS=="usb", ACTION=="add",    RUN+="/usr/share/usbmount/usbmount add"
-KERNEL=="sd*",             ACTION=="remove", RUN+="/usr/share/usbmount/usbmount remove"
-KERNEL=="ub*",             ACTION=="remove", RUN+="/usr/share/usbmount/usbmount remove"

Copied: www (from rev 40, trunk/www)


Property changes on: www
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the Usbmount-commit mailing list