summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/udev/mount-usb
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-08-29 16:29:33 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-08-29 16:29:33 (GMT)
commit1e88e460238ec219db6a617e3f79cda3936796ad (patch)
tree293673243f4e98aa221eb5b64fe73d4d669bacd3 /abs/core-testing/udev/mount-usb
parent25c30209666f591371476d272712e92e7173ce7c (diff)
parent428e5178d79eb900bbe515665b2d6c6a4b0d0f89 (diff)
downloadlinhes_pkgbuild-1e88e460238ec219db6a617e3f79cda3936796ad.zip
linhes_pkgbuild-1e88e460238ec219db6a617e3f79cda3936796ad.tar.gz
linhes_pkgbuild-1e88e460238ec219db6a617e3f79cda3936796ad.tar.bz2
Merge branch 'HEAD' of ssh://jams@knoppmyth.net/mount/repository/LinHES-PKGBUILD
* 'HEAD' of ssh://jams@knoppmyth.net/mount/repository/LinHES-PKGBUILD: mkvtoolnix mythnuv2xvid: new versions mythtv-svn: fix pretty script made mythvideo ignore php files, for fresh installs mythtv-svn: bumped to svn 21495 vdpinfo: bumped to 185.18.36 nvidia: bumped to 185.18.36 nvidia-utils: bumped to 185.18.36 skvm:removed, not needed. udev:Let's make automounting just work for USB storage devices. skvm:initial inclusion. lightweight volume manager. pmount:initial inclusion. mythappletrailers:Loading . . . mythappletrailers:Bumped. pciutils:Updated to fetch latest IDs.
Diffstat (limited to 'abs/core-testing/udev/mount-usb')
-rw-r--r--abs/core-testing/udev/mount-usb51
1 files changed, 51 insertions, 0 deletions
diff --git a/abs/core-testing/udev/mount-usb b/abs/core-testing/udev/mount-usb
new file mode 100644
index 0000000..2d3b3f5
--- /dev/null
+++ b/abs/core-testing/udev/mount-usb
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+
+DIR=/media
+DEVICE=$2
+LABEL=`/lib/udev/vol_id -L /dev/$DEVICE`
+FS=`/lib/udev/vol_id -t /dev/$DEVICE`
+
+
+mount_device () {
+ if [ "$LABEL" == "" ];
+ then
+ mkdir -p $DIR/usb-$DEVICE
+ case $FS in
+ vfat) /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/usb-$DEVICE
+ ;;
+ *) /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/usb-$DEVICE
+ ;;
+ esac
+ else
+ mkdir -p $DIR/$LABEL
+ echo $LABEL >$DIR/.$DEVICE
+ case $FS in
+ vfat) /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/$LABEL
+ ;;
+ *) /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/$LABEL
+ ;;
+ esac
+ fi
+}
+
+umount_device () {
+ if [ -e $DIR/usb-$DEVICE ];
+ then
+ umount -l $DIR/usb-$DEVICE
+ rmdir $DIR/usb-$DEVICE;
+ else
+ ULABEL=`cat $DIR/.$DEVICE`
+ umount -l $DIR/$ULABEL
+ rmdir $DIR/$ULABEL
+ rm $DIR/.$DEVICE;
+ fi
+}
+
+case $1 in
+ mount) mount_device
+ ;;
+ umount) umount_device
+ ;;
+ *) echo "Usage: mount-usb mount/umount sdxY"
+esac