给 fbterm 写了个补丁,现在可以从登录开始使用 ucimf,并用中文用户名登录系统。

76 views
Skip to first unread message

eric zhao

unread,
Apr 3, 2009, 11:29:29 PM4/3/09
to UCIMF
Dear all,

给 fbterm 写了个补丁,现在可以从登录开始使用 ucimf,并用中文用户名登录系统。

方法如下:
0、建立一个中文用户名的用户
debian、ubuntu 提供的 shadow 软件包打过补丁 506_relaxed_usernames,
可以直接建立 非ascii编码的用户名的用户,包括中文用户名的用户;
其他发行版可以自己给 shadow 软件包打补丁 506_relaxed_usernames,
或手工编辑 /etc/passwd /etc/group /etc/shadow /etc/gshadow 创建中文用户名的用户。

1、给 fbterm 打补丁 fbterm-1.4_run_command.patch,并重新编译安装。

2、写一个登录脚本 /bin/login.sh
------------------------------
cat > /bin/login.sh << eof
#!/bin/sh
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
exec /usr/bin/fbterm -i /usr/bin/fbterm_ucimf /bin/login
eof
chmod 700 /bin/login.sh
==============================

3、编辑 /etc/inittab
修改其中一行,
如 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 38400
为 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 38400 -n -l /root/
login.sh
如果不用登录脚本,应修改为
5:2345:respawn:/sbin/agetty -I '\033(K' tty5 38400 -n -l /usr/bin/env
- LANG=zh_CN.UTF-8 /usr/bin/fbterm -i /usr/bin/fbterm_ucimf /bin/login
但这样 init 会抱怨这一行参数太长,并拒绝运行。

4、init q,之后切换到 tty5 就可以用 Ctrl_Space 激活输入法,用中文登录系统。

遗留问题:
1、agetty timeout 不知怎样设置为无穷大(-t 参数不知行不行),
fbterm 启动时会刷新屏幕,不管当前使用的是不是启动 fbterm 的虚拟终端,甚至是 X,
这样会把 两个虚拟终端 显示混合在一起,X 下类似,
切换到 fbterm 所在虚拟终端,再切换回来则正常,超时则继续这样循环,
如果登录到 fbterm 所在虚拟终端,则一切正常。:(

2、想在登录脚本 /bin/login.sh 中做修正,
可不知道怎么得到当前正激活的虚拟终端设备号,
tty 命令只能得到 shell 运行的虚拟终端设备号。:(

补丁:
fbterm-1.4_run_command.patch
http://code.google.com/p/fbterm/issues/detail?id=15

debian shadow 506_relaxed_usernames
http://ftp.debian.org/debian/pool/main/s/shadow/shadow_4.1.1.orig.tar.gz
http://ftp.debian.org/debian/pool/main/s/shadow/shadow_4.1.1-6.diff.gz
补丁在这里
http://ftp.debian.org/debian/pool/main/s/shadow/shadow_4.1.1-6.dsc
这里有提取出来的单个文件
http://www.linuxsir.org/bbs/attachment.php?attachmentid=48886&d=1223302157

eric zhao

unread,
Apr 3, 2009, 11:31:58 PM4/3/09
to UCIMF
更正,
5:2345:respawn:/sbin/agetty -I '\033(K' tty5 38400 -n -l /root/
login.sh 中
/root/login.sh 应为 /bin/login.sh

Mat

unread,
Apr 4, 2009, 6:01:58 AM4/4/09
to uc...@googlegroups.com
Dear Eric Zhao,
太棒了! 很高興看到你對中文 console terminal 所作的努力。我剛剛在最新的 download_build.sh
[1]先加上了這個 fbterm command 的 patching。方便有興趣的人也可以很快的下載編譯測試。若有相關的 Report,
這裡會盡力協助 feedback 至 FbTerm!

sincerely, Mat.

[1]. http://code.google.com/p/ucimf/source/browse/scripts/download_build.sh

2009/4/4 eric zhao <ericzha...@gmail.com>:

eric zhao

unread,
Apr 9, 2009, 10:30:46 AM4/9/09
to uc...@googlegroups.com
Dear all,

遗留问题已解决。

需要给 fbterm 打补丁 fbterm-1.4_launch_from_non-current_vt.patch
http://fbterm.googlecode.com/issues/attachment?aid=-5118988617964477914&name=fbterm-1.4_launch_from_non-current_vt.patch

修改 /bin/login.sh 为


------------------------------
cat > /bin/login.sh << eof
#!/bin/sh
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8

export HOME=/root


exec /usr/bin/fbterm -i /usr/bin/fbterm_ucimf /bin/login
eof
chmod 700 /bin/login.sh
==============================

现在可以舒舒服服用登录系统。
等有空时整理为一份文档,CJK 环境下可以直接用母语登录。

新问题:
1、fbterm fbterm_ucimf 以 root 权限运行,有必要降低权限。
2、fbterm 无全局配置文件,以此方式运行时,配置文件位于 /root/.fbtermrc。
3、ucimf 生成 log 位于 /root/.ucimf-log。
4、只能在一个虚拟终端启动 fbterm。(可以用 Ctrl_Alt_C 激活新登录,并用 Ctr_Alt_数字键 切换,所以这个不算大问题)

请参考:
http://code.google.com/p/fbterm/issues/detail?id=16

Reply all
Reply to author
Forward
0 new messages