centos - linux下/etc/sysconfig/i18n在系统启动时什么时候被调用的?
ringa_lee
ringa_lee 2017-04-17 11:38:49
[Linux讨论组]

我想修改centos6.5下的终端中的字体,tty下通过命令

setfont /lib/kbd/consolefonts/ter-p20b.psf.gz

成功修改了字体。于是想将其设置为终端下的默认字体。打开了/etc/sysconfig/i18n文件,将其修改为:

LANG="en_US.UTF-8"
SYSFONT="ter-p20b"

其中的SYSFONT无论设置成

SYSFONT="ter-p20b.psf.gz"

还是

SYSFONT="/lib/kbd/consolefonts/ter-p20b.psf.gz"

均在重启后没看到效果。网上找了很久,发现该网页中这样描述:

/etc/sysconfig/i18n
Controls the system font settings. The language variables are used in /etc/profile.d/lang.sh. An example i18n file:

LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"

Options:

  • LANG= set locale for all categories, can be any two letter ISO language code.
  • LC_CTYPE= localedata configuration for classification and conversion of characters.
  • LC_COLLATE= localedata configuration for collation (sort order) of strings.
  • LC_MESSAGES= localedata configuration for translation of yes and no messages.
  • LC_NUMERIC= localedata configuration for non-monetary numeric data.
  • LC_MONETARY= localedata configuration for monetary data.
  • LC_TIME= localedata configuration for date and time.
  • LC_ALL= localedata configuration overriding all of the above.
  • LANGUAGE= can be a : separated list of ISO language codes.
  • LINGUAS= can be a ' ' separated list of ISO language codes.
  • SYSFONT= any font that is legal when used as /usr/bin/consolechars -f $SYSFONT ... (See console-tools package for consolechars command)
  • UNIMAP= any SFM (screen font map, formerly called Unicode mapping table - see consolechars(8))

    /usr/bin/consolechars -f $SYSFONT --sfm $UNIMAP

  • SYSFONTACM= any ACM (application charset map-see consolechars(8))

    /usr/bin/consolechars -f $SYSFONT --acm $SYSFONTACM

The above is used by the /sbin/setsysfont command (which is run by rc.sysinit at boot time.)

我尝试了下setsysfont命令,正确地显示了字体;但是发现系统中没有consolechars命令(yum中也没有),查看了下rc.sysinit文件,没有找到关于setsysfont或者使用i18n的语句。
但是我曾经改过1i8n中的LANG,而且在重启后tty中生效了(我改成了中文,在tty下显示的乱码),这说明系统的确启动时读取了该文件。请问系统到底是在什么时候调用的该文件,其中的SYSFONT为什么没有同时生效呢?

ringa_lee
ringa_lee

ringa_lee

全部回复(1)
PHP中文网

纯终端 显示中文会是方块,需要给内核打补丁,并设置内核的framebuffer支持,具体可以参考1

不打补丁可以使用fbterm来显示中文。

setfont是修改字体而无法解决中文显示的问题。


  1. http://blog.chinaunix.net/uid/436750.html ↩

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号