fstab-sync

David Zeuthen david at fubar.dk
Thu Jul 15 13:23:50 PDT 2004


On Thu, 2004-07-15 at 04:24 -0400, Ray Strode wrote:
> Hi,
> 
> One of the projects I've been working on over the last week or so with
> John Palmieri is getting auto mounting of devices with HAL and gnome-
> volume-manager to work for Fedora.  

Cool.

> One piece of the puzzle was to write
> a replacement for fstab-update.sh in C that generates nicer mount point
> names and is a little more robust.
> 

Yay, it feels more right to write it in C when we're messing with such
an important file :-)

> I've put the result of this work up:
> 
> http://people.redhat.com/~rstrode/fstab-sync-07-14-2004.patch
> 

OK, I just had a look at your updated patch.

> The code hasn't seen much testing, so it probably has quite a few bugs,
> but it seems to work for me (I've tested it with two different usb
> flash drives, cd's, cdr's, and cdrw's)
> 
> Note the updfstab program that comes with kudzu may not play nice with
> this program, so if you have that program installed and hotplug is
> currently calling it directly, be sure to turn that off.  Also, it's
> probably not too good of an idea to configure HAL to callout both fstab-
> update.sh and this new program.

A few observations:

1. I had to write a small wrapper, see [1], to use it; is this intended?
It would be nice if we could just symlink to the installed binary.

2. The program put /dev/hda1 into my fstab but that one is already there
as LABEL=/. This can be resolved by looking at the volume.label for the
volume you are processing.

3. There is an entry for my cd-rom drive only when I've got a disc in
the drive; this breaks the current hal patch for gnome-vfs (though when
J5's changes are in this should no longer be required).
    
However, I think that for removable storage without partition tables it
makes sense to have the fstab entry anyway; you can check this when
processing a hal-device where both block.no_partitions is TRUE and
block.is_volume is FALSE. 

This applies to cdrom, floppy, ls120, zip and other funny drives (I
haven't tested it on a zipdrive though, haven't got one yet). It would
be cool to choose the <name> in /media/<name> after the type or
capabilities of the drive; e.g. if I have a CD-ROM and a DVD-RW I would
get /media/cdrom and /media/dvdrw. You can use information in the
storage.cdrom.* capabilities for this. Also, check out gnome-vfs-hal-
mounts.c in gnome-vfs for how the desktop visible name is computed.

4. Mounting from the program doesn't seem very useful; as hald runs as
root it means that the desktop session won't have write privileges and
you need to drop to a root shell to unmount the volume.

5. The program uses the kudzu option to recognize entries made by the
program, perhaps this should be 'hal' instead? If think it could be
useful to host this program with the hal package as it's not Fedora
specific? If we do this we should probably use the 'hal' option and also
host the (trivial) patch to mount that achieves this as well.

And yeah, it does look a bit better when the mount path is prepended
by /mnt/hal :-). It looks good.

Many Thanks,
David

[1] :
#!/bin/bash
if test "$1" = "add"; then
  /usr/local/sbin/fstab-sync --add=$UDI
elif test "$1" = "remove"; then
  /usr/local/sbin/fstab-sync --remove=$UDI
fi

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list