一半君的总结纸

听话只听一半君

Thinkpad T410 换了个taobao来的键盘后tty里乱码 X下正常

某天突然发现ctrl-alt-f2 切换tty后 ~ 和 | 打不出来, 按~出来的是像两个e水平摞在一起的字符

后发现以root运行

loadkeys -d

就行了,但只是当前session有效,重启就又不行了
后来搜到只需要改

[fucker@localhost ~]$ cat /etc/vconsole.conf
KEYMAP="uk"
FONT="latarcyrheb-sun16"

之前是uk,换成us后重启,问题依旧

尝试着在这里改过

system-config-keyboard

也是重启就失效了

最后发现需要改的地方在

[fucker@localhost ~]$ cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=cl/root crashkernel=auto  vconsole.font=latarcyrheb-sun16 rd.lvm.lv=cl/swap vconsole.keymap=uk rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

把上面的 vconsole.keymap=uk 换成 vconsole.keymap=us
然后运行

grub2-mkconfig --output=/boot/grub2/grub.cfg

即可
ps: CentOS 7 开始转用 grub2,配置文件在 /boot/grub2/grub.cfg,但是这个不是用来直接改的,应该修改 /etc/default/grub 和 /etc/grub.d/ 里的script,然后用 grub2-mkconfig 生成 /boot/grub2/grub.cfg

参考:
Setting keyboard layout

Searching for grub configuration file in CentOS 7

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: