B166Er 的窝

Happy coding

XFCE4中自动挂载的乱码问题

B166Er posted @ 2008年6月12日 07:09 in hacking with tags debian exo-mount gnome-mount hal linux preference.fdi XFCE , 6198 阅读

昨天在研究linux下的音乐播放软件的时候,突然意识到一个重大的问题:我的活动硬盘在XFCE下竟然中文文件名全都是问号。以前也曾经想过这个问题, 当然,一种简单的解决方式就是修改/etc/fstab,在里面加上相应的设备,以及它的uft8支持。但是...现在的linux不会这么蠢吧?!如果 我有100个移动设备,难道还要对每个都添加相应的项到/etc/fstab里吗?

一通 google 之后得知,HAL(hardware abstract layer)可以识别插入的移动设备,并要求系统自动挂载(大概就是这样吧,具体的原理不晓得,所以说错了请大家包涵:))。接下来又是一通 google,心情也随搜索结果的变化而变化....大体过程不说了,最后的结果是:对于 xfce4,现有的thunar就是不能识别中文,需要一个补丁。这个补丁是打在 exo-mount 上的 (这是 gnome-mount的替代物,但是竟然没有考虑 hal 中的挂载选项,天知道xfce的人是怎么想的!)。

不论如何,补丁有:
https://bugzilla.altlinux.org/attachment.cgi?id=2029&action=diff
这里有一个更简单的,我没试过。。。
http://rinoworks.blogspot.com/2007/11/xfce-44.html
源代码也有:

http://thunar.xfce.org/pwiki/documentation/installation


注 意,exo-mount是一个可执行文件,在 exo-VERSION这个包里。所以,直接打包,编译,安装exo-VERSION 这个包就可以....过程如thunar的wiki上所述。(./configure的过程会提示缺少什么开发包,直接apt-get即可,注意包的名称 可能是:libPKGNAME-dev之类的。如果 ./configure --prefix="/usr/local",则最后会装到 /usr/local/bin下,不过系统似乎会对local下的程序优先执行之....)

当然,光这样还不行,得修改 HAL 的“策略”,debian 中相应的是这个文件:/etc/hal/fdi/policy/preference.fdi。留个备份然后改之(网上的帖子五花八门,有的说不用改这 个,直接 在gconf-edit中加一个string就可以了,可是我这里的纯xfce系统似乎没有这个相应的项,因此更确定了去修改Hal的策略)合适位置加上 下面这些:

<device>
<!--dmask=000,fmask=111 will make directories accessible to all, while files will stay non-executable -->
<match key="volume.fstype" string="ntfs">
<append key="volume.mount.valid_options" type="strlist">dmask=000</append>
<append key="volume.mount.valid_options" type="strlist">fmask=111</append>
</match>
</device>

<device>
<!-- Use UTF-8 charset for vfat -->
<match key="volume.fstype" string="vfat">
<merge key="volume.policy.mount_option.iocharset=utf8" type="bool">true</merge>
</match>
</device>

<device>
<match key="storage.hotpluggable" bool="false">
<match key="storage.removable" bool="false">
<merge key="storage.automount_enabled_hint" type="bool">false</merge>
</match>
</match>
</device>

然后

sudo /etc/init.d/hal stop
sudo /etc/init.d/hal start


就行啦。

注意到 Hal 的网站上好像还有针对 ipod的策略,以后如果有了 ipod 再想自动挂载它吧!当然,还可以用 checkinstall 生成一个exo的debian包,这样下次坏了就不用重新编译exo啦,这正是我刚才做的事。。。

Head_small
B166Er 说:
2008年6月30日 00:10

Debian package can be found at

<a href="http://www.mediafire.com/?gmwatbzd0hz">http://www.mediafire.com/?gmwatbzd0hz</a>

babysitting services 说:
2021年9月19日 18:20

At this time, depending regarding the fabric and your quality, a carpet is washed just by deep housecleaning, hand wash or even machine clear. If you will can’t work out what may be more important, then a qualified carpet housecleaning Dubai service can get done wonder for use on your carpet.

12th Time Table 2024 说:
2023年2月14日 18:24

12th Class Time Table 2024 on this page. The Students Board are very curious to check Board of Intermediate Revised Exam Date 2024 for Arts Commerce and Science. Recently, the Intermediate Board has issued the 12th Date Sheet 2024 on the official website. 12th Time Table 2024 So those Students who are going to appear in the Inter Examination can download Time Table 2024 on the main portal.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter