From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wout Mertens Date: Thu, 11 Dec 2003 15:37:45 +0000 Subject: Re: Working on a usb-storage hotplug script Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Yesterday at 20:49, Olaf Hering sat down and wrote: > On Wed, Dec 10, Wout Mertens wrote: > > > Yesterday at 17:09, Olaf Hering ponderously produced: > > > > > On Tue, Dec 09, Wout Mertens wrote: > > > > > > > Comments? > > > > > > forget 2.4, work on 2.6. 2.6 will give you a block event if there is > > > something of interrest. > > > > Well, you're right. I just created a hotplug script that will automount > > all block devices that get attached. I use this behaviour to use a USB > > key as a token for connecting to a VNC session from a thin client. > > > > It's way cleaner than the 2.4 version... > > > > Here's the script, comments? > > to make it more generic, use /proc/self/mounts and sed instead of tr. Sure :) Here are the changed lines: ==================== done < /proc/self/mounts done < /proc/self/mounts echo $1 | sed 's/[ /?*\"<>]/_/g' set `echo $DEVPATH | sed 's/\// /g'` set `echo $PASSWD | sed 's/:/ /g'` ==================== Playing with it, I see that 2.6 is very robust, and the only problem is that when you mount something as "sync", it doesn't sync the directory entry until after you type "sync". It does write all the data first though. Sigh. This is where supermount_ng comes in. I realize that the cleaner way would be to rewrite fstab and let KDE/Gnome help the user with mounting/unmounting. But that won't help for USB login tokens... Wout. ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel