Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Oct 2004 12:47:46 +0200
From:      Franz Klammer <klammer@webonaut.com>
To:        gnome <freebsd-gnome@FreeBSD.org>
Subject:   USB (umass) Automounter
Message-ID:  <416A64D2.9030209@webonaut.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------080405070201040504090003
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

hi all!

i've (tried to ;-)) written a small applet in python to automount
USB umass devices: bsd_usb_tools-0.1

attached the shar for public testing.

how does it work resp. some data:

* there no /etc/fstab entries necessary
* default mount point-base: ~/usbdrives
* if the usbdrives dosn't exist it ask you for a mountbase
  and creates the directory
* it looks for /dev/da?s? devices and if found it
    1. creates a mountpoint: e.g: ~/usbdrives/memstick@da0s1
    2. mount the memstick
    3. start nautilus (turn on/off this feature per
       gconf-key /apps/bsd_usb_tools/start_app_or_dialog)
* if unmounted by nautilus it:
    - removes the mountpoint
    - don't try mount again until the memstick is removed and
      reinserted. the second way to remount a device is double click
      the applet
* three applet icon colors:
    white: no device mounted
    red: working
    green: one or more devices mounted
* it logs more or less usefull data into syslog. this can turned off
   by editig the script and set DEBUG=False.
* if there are yn da* devices which are not created by usbd this applet
  can't be used now because it always try to mount them.
* everything is mounted as memstick -> if possible i try to avoid this
  with checking the output of "camcontrol devlist" in a later version.
* because there is no fstab enytry the device is invisible in gnome until
  the stick is inserted and mounted.

i send it to the list because i'm curisous about what others think about
it and unfortunately i've only a memstick and no other devices to test.
if there is a positive feedback i try to add more features.

franz.



-- 
webonaut.com :: web technology
klammer@webonaut.com :: http://webonaut.com/
fon +43-664-3434708
--
MIG_media intelligence group > agentur für werbung & neue medien
A-5020 Salzburg > Linzergasse 21

Fon +43-662-453091-0 > Fax -99
office@mig.co.at > http://www.mig.co.at
--


--------------080405070201040504090003
Content-Type: text/plain;
 name="bsd_usb_tools.shar"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bsd_usb_tools.shar"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	bsd_usb_tools
#	bsd_usb_tools/Makefile
#	bsd_usb_tools/distinfo
#	bsd_usb_tools/pkg-descr
#	bsd_usb_tools/pkg-plist
#
echo c - bsd_usb_tools
mkdir -p bsd_usb_tools > /dev/null 2>&1
echo x - bsd_usb_tools/Makefile
sed 's/^X//' >bsd_usb_tools/Makefile << 'END-of-bsd_usb_tools/Makefile'
X# New ports collection makefile for:	gusbam
X# Date created:				98 Oct 2004
X# Whom:					Franz Klammer <klammer@webonaut.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	bsd_usb_tools
XPORTVERSION=	0.1
XCATEGORIES=	sysutils gnome
XMASTER_SITES=	http://webonaut.com/distfiles/${PORTNAME}/
X
XMAINTAINER=	klammer@webonaut.com
XCOMMENT=	some comment here ;-)
X
XUSE_BZIP2=	yes
XUSE_X_PREFIX=	yes
XUSE_REINPLACE=	yes
XUSE_PYTHON=	yes
XUSE_GNOME=	pygnome2
X
Xdo-build:
X	@${REINPLACE_CMD} -e 's|@X11BASE@|${X11BASE}|g' \
X		${WRKSRC}/*.py
X	@${REINPLACE_CMD} -e 's|@X11BASE@|${X11BASE}|g' \
X		${WRKSRC}/*.server
X	@${FIND} ${WRKSRC} -name '*.bak' -delete
X	@${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}
X
Xdo-install:
X	${MKDIR} ${X11BASE}/libexec/${PORTNAME}
X	${MKDIR} ${X11BASE}/share/gnome/pixmaps/${PORTNAME}
X	@${INSTALL_SCRIPT} ${WRKSRC}/*.py* \
X		${X11BASE}/libexec/${PORTNAME}/
X	@${INSTALL_DATA} ${WRKSRC}/*.server \
X		${X11BASE}/libdata/bonobo/servers/
X	@${INSTALL_DATA} ${WRKSRC}/*.png \
X		${X11BASE}/share/gnome/pixmaps/${PORTNAME}
X	@${INSTALL_DATA} ${WRKSRC}/*.entries \
X		${X11BASE}/etc/gconf/schemas/
X
X.include <bsd.port.mk>
END-of-bsd_usb_tools/Makefile
echo x - bsd_usb_tools/distinfo
sed 's/^X//' >bsd_usb_tools/distinfo << 'END-of-bsd_usb_tools/distinfo'
XMD5 (bsd_usb_tools-0.1.tar.bz2) = aa8b6c6806e4be8b4d0bec0943b7201b
XSIZE (bsd_usb_tools-0.1.tar.bz2) = 9012
END-of-bsd_usb_tools/distinfo
echo x - bsd_usb_tools/pkg-descr
sed 's/^X//' >bsd_usb_tools/pkg-descr << 'END-of-bsd_usb_tools/pkg-descr'
XGNOME Application and Applet written in Python to start 
Xthe gnome-terminal with a specified profile.
END-of-bsd_usb_tools/pkg-descr
echo x - bsd_usb_tools/pkg-plist
sed 's/^X//' >bsd_usb_tools/pkg-plist << 'END-of-bsd_usb_tools/pkg-plist'
X@unexec gconftool-2 --direct --config-source=xml::/usr/X11R6/etc/gconf/gconf.xml.defaults --unload /usr/X11R6/etc/gconf/schemas/bsd_usb_tools.entries /apps/bsd_usb_tools > /dev/null || /usr/bin/true
Xetc/gconf/schemas/bsd_usb_tools.entries
X@exec gconftool-2 --direct --config-source=xml::/usr/X11R6/etc/gconf/gconf.xml.defaults --load /usr/X11R6/etc/gconf/schemas/bsd_usb_tools.entries /apps/bsd_usb_tools > /dev/null || /usr/bin/true
Xlibexec/bsd_usb_tools/usbtool_applet.py
Xlibexec/bsd_usb_tools/usbtool_applet.pyc
Xlibdata/bonobo/servers/USBToolApplet.server
Xshare/gnome/pixmaps/bsd_usb_tools/idle.png
Xshare/gnome/pixmaps/bsd_usb_tools/loaded.png
Xshare/gnome/pixmaps/bsd_usb_tools/working.png
X@dirrm libexec/bsd_usb_tools
X@dirrm share/gnome/pixmaps/bsd_usb_tools
END-of-bsd_usb_tools/pkg-plist
exit


--------------080405070201040504090003--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?416A64D2.9030209>