LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-06-2007, 01:03 AM   #1
shreks
Member
 
Registered: Aug 2004
Posts: 79

Rep: Reputation: 15
How to load customized HAL policy?


I found that every time when I plugged in my portable hard drive (VFAT), HAL used the mount option "shortname=lower" to mount the drive, as shown in /media/.hal-mtab. However this causes lots of problems of name conversion. It's better use "shortname=mixed". So I wrote a simple hal policy file called storage-policy.fdi:

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
<device>
<match key="block.is_volume" bool="true">
<match key="volume.fsusage" string="filesystem">
<match key="volume.fstype" string="vfat">
<merge key="volume.policy.mount_option.shortname=" type="string">shortname=mixed</merge>
</match>
</match>
</match>
</device>
</deviceinfo>

I put it under /usr/share/hal/fdi/policy/95userpolicy/ and restart haldaemon, and then I used lshal command to check if the new policy has been loaded:

[shrek@matrix ~]$ lshal | grep shortname
volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec', 'utf8', 'shortname=', 'codepage=', 'iocharset=', 'umask=', 'uid='} (string list)
volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec', 'utf8', 'shortname=', 'codepage=', 'iocharset=', 'umask=', 'dmask=', 'fmask=', 'uid='} (string list)
volume.policy.mount_option.shortname= = 'mixed' (string)

The last line shows that the customized policy worked. However the .hal-mtab in /media/ says the following:

[shrek@matrix policy]$ cat /media/.hal-mtab
/dev/sdb 500 0 vfat nosuid,nodev,uhelper=hal,shortname=lower,uid=500 /media/MYUSBDRIVE

I don't know why. Anyone can tell me where went wrong? Thanks a lot!
 
Old 06-13-2007, 04:45 PM   #2
cgrim
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora
Posts: 1

Rep: Reputation: 0
Question

Hello,

I've the same problem in Fedora 7. In Fedora 6 there was automatic mounting of vfat with shortname=mixed ... but now, i'm in trouble after upgrade

I've done similar FDI file. In lshal everything looks OK (shortname=mixed) but in mount listing is still shortname=lower.

What else can I do with HAL to force it to mount vfat filesystems with shortname=mixed?

Thanks.

Last edited by cgrim; 06-13-2007 at 04:46 PM.
 
Old 06-16-2007, 04:52 AM   #3
shreks
Member
 
Registered: Aug 2004
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by cgrim
Hello,

I've the same problem in Fedora 7. In Fedora 6 there was automatic mounting of vfat with shortname=mixed ... but now, i'm in trouble after upgrade

I've done similar FDI file. In lshal everything looks OK (shortname=mixed) but in mount listing is still shortname=lower.

What else can I do with HAL to force it to mount vfat filesystems with shortname=mixed?

Thanks.
Try to install gnome-mount-nautilus-properties if you use Gnome.
 
Old 07-10-2007, 05:36 PM   #4
lampje
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Hi shreks, cgrim,

I have found that a script in /usr/share/hal... doesn't help, and gnome-mount-nautilus-properties seems to be unavailable -- for Ubuntu at least. In a posting on a different forum, someone mentioned the gnome configuration database. By changing the relevant entry I could make mount use shortname=lower, so you may be able to get the system to work to your liking as well. Start gconf-editor from an xterm. Click Edit -> Find or ctrl-F and search for vfat. It should find the key /system/storage/default_options/vfat/mount_options, so you may also go there directly. Edit the mount_options key by double-clicking and set shortname to your preference. The change takes effect immediately, so re-inserting the USB card reader was enough in my case.

Again, this is assuming you use Gnome, but it may be helpful to others as well.
 
Old 07-11-2007, 02:05 AM   #5
shreks
Member
 
Registered: Aug 2004
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lampje
Hi shreks, cgrim,

I have found that a script in /usr/share/hal... doesn't help, and gnome-mount-nautilus-properties seems to be unavailable -- for Ubuntu at least. In a posting on a different forum, someone mentioned the gnome configuration database. By changing the relevant entry I could make mount use shortname=lower, so you may be able to get the system to work to your liking as well. Start gconf-editor from an xterm. Click Edit -> Find or ctrl-F and search for vfat. It should find the key /system/storage/default_options/vfat/mount_options, so you may also go there directly. Edit the mount_options key by double-clicking and set shortname to your preference. The change takes effect immediately, so re-inserting the USB card reader was enough in my case.

Again, this is assuming you use Gnome, but it may be helpful to others as well.
Hi Thanks a lot for your help! Since I'm using Fedora 7, gnome-mount-nautilus-properties is available. Your gconf-editor approach is more generic and can be adapted to other platforms. I guess the problem occurs because of some changed made in Linux kernel modules "vfat" which uses the default mount options "shortname=lower". Therefore, in order to preserve exact file names, some settings must be made to change this default mount options, regardless of what desktop environment or linux distributions you use.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hal "volume.policy.mount_option.sync" ignored in opensuse 10.2 ? rtspitz Linux - Software 2 07-08-2007 05:46 PM
HAL won't load akjo Slackware 9 01-23-2007 09:03 AM
How to make customized password policy. makkays Linux - Security 1 10-09-2006 03:34 AM
GENTOO - problem running 'make load' for selinux policy Snerkel Linux - Distributions 3 09-21-2006 11:30 PM
GENTOO - problem running 'make load' for selinux policy Snerkel Linux - Software 1 01-24-2005 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration