|
前些日子Freebsdchina 上不了,吓了一大跳。
一:系统是 FreeBSD 6.1 安装没什么特别的
二:系统 locale 的设置:
- LANG=zh_CN.GBK
- LC_ALL=zh_CN.GBK
- charset=GBK
复制代码
三:先装 samba3/usr/ports/net/samba3),在 /etc/local/etc/smb.conf 中要加上:
-
- [global]
- display charset = CP936
- unix charset = CP936
- dos charset = CP936
复制代码
四:装 netatalk:
要在 kernel 中打开 netatalk 支持,然后重新编译内核
-
- options NETATALK # AppleTalk
复制代码
-
- #cd /usr/ports/net/netatalk
- #make extract
复制代码
到 http://www003.upp.so-net.ne.jp/hat/netatalk/cjk.html 去下那五个补丁,(要注意:utf8.c 要 Revision 1.1.2.6 的那个,否则会编译不过)放在/usr/ports/net/netatalk/files/ 中,然后打上补丁:
-
- #cat patch_cmd
- cd /usr/ports/net/netatalk/work
- zcat /usr/ports/net/netatalk/files/netatalk-2.0.3-cjk-2.patch.gz | patch -p0
- mv netatalk-2.0.3/libatalk/unicode/utf8.c netatalk-2.0.3/libatalk/unicode/utf8.c.orig
- mv netatalk-2.0.3/libatalk/unicode/util_unistr.c netatalk-2.0.3/libatalk/unicode/util_unistr.c.orig
- cp /usr/ports/net/netatalk/files/*.c netatalk-2.0.3/libatalk/unicode/
- #cp netatalk-2.0.3/libatalk/unicode/utf8.c netatalk-2.0.3/libatalk/unicode/
- #cp /usr/ports/net/netatalk/files/util_unistr.c netatalk-2.0.3/libatalk/unicode/
- cd netatalk-2.0.3/etc/afpd/
- zcat /usr/ports/net/netatalk/files/non-ascii-volume.patch.gz | patch
- zcat /usr/ports/net/netatalk/files/catsearch-terminator.patch.gz | patch
- cd /usr/ports/net/netatalk
复制代码
打完补丁后请继续编译:
- #make configure
- #make build
- #make install
复制代码
五:安装后的设定:
/etc/rc.conf 中须打开netatalk
- netatalk_enable="YES"
- atalkd_enable="YES"
- papd_enable="YES"
- cnid_metad_enable="YES"
- afpd_enable="YES"
复制代码
- #cat /usr/local/etc/AppleVolumes.default
- /home/public public volchrset:CP936 maccharset:MAC_CHINESE_SIMP
- #cat /usr/local/etc/afpd.conf
- -unixcodepage CP936 -maccodepage MAC_CHINESE_SIMP
复制代码
也许你可以试一下其它的 unixcodepage & volchrset 的值.例如 UTF8 GBK 等等.
测试的文件名中包括繁简中文和日文,测试通过的客户端系统有:MAC OS 8.6; MAC OS 9.2; MAC OS X 10.28; MAC OS X 10.45; PC WIN2000简体版; PC WINXP简体版; FREEBSD (通过 putty pc; ssh mac 来显示).
因条件有限,win98,win2003未进行测试. |
|