<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Into.the.Void. &#187; automount</title>
	<atom:link href="http://www.void.gr/kargig/blog/tag/automount/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.void.gr/kargig/blog</link>
	<description>Into The Void</description>
	<lastBuildDate>Sat, 07 Aug 2010 08:06:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using halevt to automount media and make them appear on ROX desktop</title>
		<link>http://www.void.gr/kargig/blog/2009/06/23/using-halevt-to-automount-media-and-make-them-appear-on-rox-desktop/</link>
		<comments>http://www.void.gr/kargig/blog/2009/06/23/using-halevt-to-automount-media-and-make-them-appear-on-rox-desktop/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 22:10:06 +0000</pubDate>
		<dc:creator>kargig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[automount]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[halevt]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[pinboard]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[rox]]></category>

		<guid isPermaLink="false">http://www.void.gr/kargig/blog/?p=610</guid>
		<description><![CDATA[With the recent addition of halevt in Gentoo&#8217;s portage it is now relatively easy to automatically mount media like USB sticks and CD/DVD discs on /media. 
What I wanted to do was to emulate my previous set of configs and scripts that ivman used to create icons of automatically mounted media on ROX desktop (called [...]]]></description>
			<content:encoded><![CDATA[<p>With the recent addition of <a href="http://packages.gentoo.org/package/sys-apps/halevt">halevt in Gentoo&#8217;s portage</a> it is now relatively easy to automatically mount media like USB sticks and CD/DVD discs on /media. </p>
<p>What I wanted to do was to emulate my <a href="http://www.void.gr/kargig/blog/2006/07/24/create-icons-on-rox-desktop-of-automounted-media-by-ivman/">previous set of configs</a> and <a href="http://www.void.gr/kargig/blog/2006/09/23/rox-icons-ivman-continued/">scripts</a> that ivman used to create icons of automatically mounted media on <a href="http://roscidus.com/desktop/node/169">ROX desktop (called pinboard)</a>. I am using ROX pinboard on top of my favorite window manager, <a href="http://fluxbox.org">fluxbox</a>.</p>
<p>The idea is that <a href="http://www.nongnu.org/halevt/">halevt</a> is started by the fluxbox startup config file and when a new device is attached to the computer, halevt config calls a script that creates an icon on the ROX pinboard using ROX rpc. When a device needs to be removed ROX pinboard is configured to call a special eject command that checks for a couple of things before unmounting the device and calling the script to remove the icon from ROX pinboard.<br />
Apart from automatically mounting/unmounting of devices I have also added a nice option in the halevt config to unmount and eject the CD/DVD drive when the eject button on the device is used and of course when the CD/DVD is not in use. That emulates a bit the windows behavior that so many users have gotten used to.</p>
<p>Since the script used by halevt involves a lot of file reading/writing and parsing I thought it would be wise to convert my old <a href="http://www.void.gr/kargig/blog/2006/09/23/rox-icons-ivman-continued/">rox.panelput bash script</a> to perl. And I was correct, the speed difference, even for such simple tasks is more than noticeable.</p>
<p>The <strong>installation process</strong>. Please take notice of the user executing the commands, $ is for normal user, # is for root:<br />
0) <strong>create /usr/local/bin/ path and put it in your shell&#8217;s PATH</strong><br />
<code># mkdir /usr/local/bin<br />
$ echo "export PATH=$PATH:/usr/local/bin/" >> ~/.bashrc</code></p>
<p>1) <strong>install halevt</strong><br />
<code># echo "sys-apps/halevt ~x86" >> /etc/portage/package.keywords<br />
# emerge halevt<br />
</code><br />
<span id="more-610"></span><br />
2) create <strong>~/.halevt/HalevtConfigActions.xml</strong> in your home directory:<br />
File: <a href='http://www.void.gr/kargig/blog/wp-content/HalevtConfigActions.xml'>HalevtConfigActions.xml</a>  (right click->Save-as)</p>
<p>3) <strong>Create /usr/bin/eject.hal</strong>. Take notice that the script uses bash and not dash!<br />
<pre><code2>#!/bin/bash
if [ -z $1 ]; then
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Usage: eject.hal &lt;device&gt;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;exit
else
&nbsp;&nbsp;echo &quot;$1&quot; | egrep &quot;^/dev&quot;
&nbsp;&nbsp;if [ &quot;$?&quot; == &quot;0&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;#echo &quot;Device First, find mount point&quot;
&nbsp;&nbsp;&nbsp;&nbsp;TOSCAN=`echo &quot;$1&quot; | sed -e &#039;s/ /\\\\\\\\040/g&#039;`
&nbsp;&nbsp;&nbsp;&nbsp;TOUMOUNT=`grep &quot;$TOSCAN&quot; /proc/mounts | cut -d&quot; &quot; -f2`
&nbsp;&nbsp;&nbsp;&nbsp;UDI=`hal-find-by-property --key volume.mount_point --string &quot;$TOUMOUNT&quot;`
&nbsp;&nbsp;&nbsp;&nbsp;DISC=`hal-get-property --udi &quot;$UDI&quot; --key volume.is_disc`
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/rox.panelput.pl Remove &quot;$TOUMOUNT&quot;
&nbsp;&nbsp;&nbsp;&nbsp;halevt-umount &quot;$1&quot;
&nbsp;&nbsp;&nbsp;&nbsp;halevt-umount -s
&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$DISC&quot; == &quot;true&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/bin/eject -p &quot;$1&quot; &amp;&gt;/dev/null
&nbsp;&nbsp;&nbsp;&nbsp;fi
&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;#echo &quot;Mount Point First, find device&quot;
&nbsp;&nbsp;&nbsp;&nbsp;UDI=`hal-find-by-property --key volume.mount_point --string &quot;$1&quot;`
&nbsp;&nbsp;&nbsp;&nbsp;DISC=`hal-get-property --udi &quot;$UDI&quot; --key volume.is_disc`
&nbsp;&nbsp;&nbsp;&nbsp;TOSCAN=`echo &quot;$1&quot; | sed -e &#039;s/ /\\\\\\\\040/g&#039;`
&nbsp;&nbsp;&nbsp;&nbsp;TOUMOUNT=`grep &quot;$TOSCAN&quot; /proc/mounts | cut -d&quot; &quot; -f1`
&nbsp;&nbsp;&nbsp;&nbsp;/usr/local/bin/rox.panelput.pl Remove &quot;$1&quot; nowait
&nbsp;&nbsp;&nbsp;&nbsp;halevt-umount &quot;$1&quot;
&nbsp;&nbsp;&nbsp;&nbsp;halevt-umount -s
&nbsp;&nbsp;&nbsp;&nbsp;if [ &quot;$DISC&quot; == &quot;true&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/bin/eject -p &quot;$TOUMOUNT&quot; &amp;&gt;/dev/null
&nbsp;&nbsp;&nbsp;&nbsp;fi
&nbsp;&nbsp;fi
fi
&lt;/device&gt;</code2></pre><br />
File: <a href='http://www.void.gr/kargig/blog/wp-content/eject.hal'>eject.hal</a></p>
<p>4) <strong>Create /usr/bin/rox.panelput.pl</strong> perl script. The script is written very simplistically to be easily understandable and changable.<br />
File: <a href='http://www.void.gr/kargig/blog/wp-content/rox.panelput.pl'>rox.panelput.pl</a></p>
<p>5) <strong>Start halevt from fluxbox startup</strong>..make sure <strong>~/.fluxbox/startup</strong> file contains at least the following, changing YOURUSERNAME to the one appropriate:<br />
<code>/usr/local/bin/rox.panelput.pl Restore<br />
killall -9 halevt; halevt -f -u YOURUSERNAME -g plugdev &#038;<br />
/usr/bin/rox -p pinboard</code></p>
<p>6) <strong>go to ROX options and change &#8216;eject command&#8217; to use eject.hal</strong><br />
<a href="http://www.void.gr/kargig/blog/wp-content/rox-using-eject-hal-screenshot.jpg"><img src="http://www.void.gr/kargig/blog/wp-content/rox-using-eject-hal-screenshot-300x186.jpg" alt="rox-using-eject-hal-screenshot" title="rox-using-eject-hal-screenshot" width="300" height="186" class="alignnone size-medium wp-image-622" /></a></p>
<p>That should be all. Upon fluxbox restart halevt should start and when you plug in your usb the set of scripts will create an icons on ROX pinboard for you.</p>
<p>Example:<br />
<a href="http://www.void.gr/kargig/blog/wp-content/usb-mounted-by-halevt-and-rox.panelput.pl.jpg"><img src="http://www.void.gr/kargig/blog/wp-content/usb-mounted-by-halevt-and-rox.panelput.pl-300x240.jpg" alt="usb-mounted-by-halevt-and-rox.panelput.pl" title="usb-mounted-by-halevt-and-rox.panelput.pl" width="300" height="240" class="alignnone size-medium wp-image-624" /></a></p>
<p>References: <a href="http://forums.gentoo.org/viewtopic-t-731555-highlight-halevt.html">http://forums.gentoo.org/viewtopic-t-731555-highlight-halevt.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.void.gr/kargig/blog/2009/06/23/using-halevt-to-automount-media-and-make-them-appear-on-rox-desktop/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>ivman is dead, long live halevt</title>
		<link>http://www.void.gr/kargig/blog/2009/05/28/ivman-is-dead-long-live-halevt/</link>
		<comments>http://www.void.gr/kargig/blog/2009/05/28/ivman-is-dead-long-live-halevt/#comments</comments>
		<pubDate>Wed, 27 May 2009 22:06:04 +0000</pubDate>
		<dc:creator>kargig</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[automount]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[halevt]]></category>
		<category><![CDATA[ivman]]></category>
		<category><![CDATA[rox]]></category>

		<guid isPermaLink="false">http://www.void.gr/kargig/blog/?p=541</guid>
		<description><![CDATA[It&#8217;s been a while since ivman stopped working on my Gentoo box but I never had the time nor the willingness to take a look into it. It appears that ivman is incompatible with some newer versions of hal and dbus. The good thing is that there&#8217;s an alternative, it&#8217;s called halevt and as far [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since <a href="http://ivman.sourceforge.net/">ivman</a> stopped working on my Gentoo box but I never had the time nor the willingness to take a look into it. It appears that ivman is incompatible with some newer versions of hal and dbus. The good thing is that there&#8217;s an alternative, it&#8217;s called <a href="http://www.nongnu.org/halevt/">halevt</a> and as far as I&#8217;ve taken a look into it the configuration options look quite straightforward.<br />
For Gentoo, there are <a href="http://bugs.gentoo.org/show_bug.cgi?id=257933">ebuilds for halevt</a> on Gentoo bugzilla, which install just fine.</p>
<p>In my point of view there&#8217;s an issue here for Gentoo. Latest ivman (sys-apps/ivman-0.6.14) compiles just fine against all of its dependencies, but then it does nothing at all when a deviced is plugged in. If the devices are present when ivman starts then it can detect and mount them, if you plug the devices after ivman is started, then ivman does nothing at all. I think ivman is broken since hal 0.5.9.X versions. Gentoo developers stll keep ivman in the stable tree though. I find no real logic to this decision. Ivman is buggy with current stable hal and dbus. I would prefer a de-stabilization of ivman or even a package mask for it. What&#8217;s the point in keeping a package (ivman) in the stable tree since it requires not the latest stable but an older version of another package (hal) ? IMHO, since they correctly decided to stabilize hal 0.5.11-r8, which subsequently rendered ivman useless, ivman should be wiped from the stable tree.<br />
Some bugs on ivman reported on Gentoo Bugzilla: <a href="http://bugs.gentoo.org/buglist.cgi?quicksearch=ivman">http://bugs.gentoo.org/buglist.cgi?quicksearch=ivman</a></p>
<p>I once used ivman with a couple of custom scripts to <a href="http://www.void.gr/kargig/blog/2006/07/24/create-icons-on-rox-desktop-of-automounted-media-by-ivman/">create/remove icons of automounted devices on my ROX desktop</a>. I think I can make these scripts work again with halevt&#8230;I am in the process of rewriting them. More on that in the following days&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.void.gr/kargig/blog/2009/05/28/ivman-is-dead-long-live-halevt/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
