JP Vossen on 8 Feb 2013 03:13:14 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] CentOS-5.x console font troubles


Date: Wed, 6 Feb 2013 07:01:12 -0500
From: Rich Freeman<r-plug@thefreemanclan.net>

It sounds like some init.d/rc script is changing things after boot.

I agree.  (But it turns out, yes and no...)


You might try grepping these scripts for "resizecons" and "setfont" to
try to figure out what script is doing it and then look for an
associated config file.  That is the cleanest solution.

Yeah, I forgot to mention I did this and didn't find my problem:
	grep -Ril 'font' /etc/*

I hadn't tried "resize" until just now, but no joy that I can recognize. Google talks about that one a lot, but it's not actually installed.


Or, you could just write your own init.d script (or local script if
CentOS has such a concept) and stick those commands in there yourself.
  They have man pages on Gentoo at least.  I can't say that I've
personally messed around with them - I assume they work with
framebuffers as well as traditional VGA consoles.

Writing an init script doesn't work. Or rather, it works *for that init* script only, and also in effect does a clear screen before and after that init script runs. That's very disruptive. :-(

/etc/rc.local kinda works, read on...


~~~~~~~~~~~~~~~~~~~~~~~~~
I really wanted to know why this Just Works on CentOS-5.6 but not on 5.8 or 5.9, and 10+ hours later, I have enough of an answer and a really evil work-around.

Summary: RHEL/CentOS-5.7 or 5.8 made a change that I can't find that either removes something or hard-codes the '/lib/kbd/console fonts/latarcyrheb-sun16.psfu.gz' font into 'init' and/or similar places (https://bugzilla.redhat.com/attachment.cgi?id=306920).

Problem: If you change '/etc/sysconfig/i18n' to have anything other than 'SYSFONT="latarcyrheb-sun16"' that change is (now, >5.6) honored by 'udev' but is not honored by the SysV init scripts after udev or by the console after boot. This happens on my Dell R710s, R720s and all my test VMs.

Effect: The screen is really odd during boot. First it's normal, then there is a "clear screen" and the font for udev output is small, then there is a "clear screen" and the font is back to normal size, even if that's not what you wanted. Then after boot (and login), running '/sbin/setsysfont' changes the font to what you asked for, but running '/bin/setfont' changes right back to the default!

Missing detail: Some predecessor of mine changed '/etc/sysconfig/i18n' to have 'SYSFONT="LatArCyrHeb-08"' so that some script output will fit on the screen!!! I spent a long time trying to figure out how the console font had been changed, because it was NOT "vga=6" in '/boot/grub/grub.conf' like everyone on Google thinks. I knew we had done it, and I knew why, but not who or how. But our CentOS-5.6 images work fine with that change, it's only when you upgrade to 5.8 or 5.9 that it breaks!


Work-around: I spent another long time trying to solve this correctly. https://bugzilla.redhat.com/show_bug.cgi?id=448704 has some clues and patches, but in the end, more than 12 trial and error attempts failed (and boy did some of them look odd). I finally brute-forced it, with an EVIL hack:
	cp -av /lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz \
		/lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz.ORIG
	ln -s lat2-08.psfu.gz \
		/lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz

In other words, I symlinked the font I want (lat2-08) to the hard-coded/default name (latarcyrheb-sun16). Evil, evil, evil, but it works. And it looks even better (and more consistent) if you do add the "vga=6" to the kernel parms. Also, after playing around I decided that "lat2-08" looks a bit better than "LatArCyrHeb-08", so...

The other work-around, that fixed the script display but not the boot message symptoms, was to add "/sbin/setsysfont" to '/etc/rc.local' (as Rich suggested). I didn't like that because it fixed only 50% of the problem (admittedly the more important 50%) and because I didn't understand why I needed it. I still don't know exactly, but I'm close enough.


How I eventually reproduced the problem:

1. MINIMAL install using CentOS-5.6-x86_64-bin-1of8.iso *and* 2of8 (http://vault.centos.org/5.6/isos/x86_64/)
2. Boot should look fine.
3. vi '/etc/sysconfig/i18n' and set: SYSFONT="LatArCyrHeb-08"
4. Reboot, boot should look fine, and login prompt should be in new font!!! (You still do get a "clear screen" just before udev and just before login prompt, but that's livable. And setting the kernel parm "vga=6" fixes that by making *everything* small)
5. 'yum upgrade' to current (5.9)
6. Reboot, boot should look bad, as described above and login prompt should be in the wrong/bad/default font!
7. vi '/etc/sysconfig/i18n' and revert to: SYSFONT="latarcyrheb-sun16"
8. Reboot, boot should look fine again.

After step 2 above I *finally* noticed that:

* The new/stock VM: cat /etc/sysconfig/i18n
	LANG="en_US.UTF-8"
	SYSFONT="latarcyrheb-sun16"

* Our images: cat /etc/sysconfig/i18n
	LANG="en_US.UTF-8"
	SYSFONT="LatArCyrHeb-08"


Hope this is useful to someone,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug