How can I modify storage-policy.fdi to add more mount option when the oprion is variable?

Rocky Zhang rocky at userful.com
Wed Jul 13 14:30:34 PDT 2005


Hi Guys,

I installed Fedora Core 4 on my computer. And I recompiled submount
( http://submount.sourceforge.net ) and installed, I'd like to use subfs
to manage all removable storage devices.

I looked into fstab-sync help documentation, and know that I can add my
own 10-storage-policy.fdi under /etc/hal/fdi/policy to manager entry to
fstab when hotplug some device. I want to use subfs when I hotplug in a
USB key drive. So I modified the policy file to use subfs as file system
to mount, one thing I can't do that I need add "fs=$CURRENT_FILESYSTYPE"
to the mount option. The CURRENT_FILESYSTYPE value should be the same as
volume.fstype, and it depends on the USBS key drive.

My expection is that:
If USB key drive is vfat file system, automatically add an entry as
followed to fstab when hotplug in USB key drive:

"/dev/sda1 /media/FLASH_BRAND  subfs fs=vfat,sync,managed 0 0"

If USB key drive is ext2 file system, add the entry:

"/dev/sda1 /media/FLASH_BRAND  subfs fs=ext2,sync,managed 0 0"

I can match the key ( volume.fstype ) to different file system type one
by one, but it's not a good idea. Is there any way I can set volume
mount_option with different one depending on the USB key drive?

Thanks.

Rocky

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



More information about the Hal mailing list