FS#19109 - [mkinitcpio] consolefont hook only supports .psfu.gz files
Attached to Project:
Arch Linux
Opened by Alex Griffin (fflarex) - Thursday, 15 April 2010, 02:58 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 03 February 2013, 01:42 GMT
Opened by Alex Griffin (fflarex) - Thursday, 15 April 2010, 02:58 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 03 February 2013, 01:42 GMT
|
Details
Description:
The consolefont hook does not support non-unicode fonts. This means that popular fonts like Terminus don't work. |
This task depends upon
Closed by Dave Reisner (falconindy)
Sunday, 03 February 2013, 01:42 GMT
Reason for closing: Fixed
Additional comments about closing: Original bug is fixed. Do not reopen 3 year old bug reports with unrelated problems.
Sunday, 03 February 2013, 01:42 GMT
Reason for closing: Fixed
Additional comments about closing: Original bug is fixed. Do not reopen 3 year old bug reports with unrelated problems.
I also added 'read -n1' to my /etc/rc.local so I can read all the error messages and only then press a key and get my login prompt.
Anyways, I changed the file extension on my font of choice to give it the appearance of being a unicode font, and everything worked fine. I'm not sure I even understand why non-unicode fonts are explicitly disallowed.
The 'consolefont' hook should accept anything 'setfont' accepts, after all that's what is used to actually set the font.
line 11: it means, that .psfu.gz is hardcoded.
lines 17 & 18 should tell you this.
Maybe you can add a custom hook or other override.
I have no idea why only unicode fonts are allowed.
FS#19079.http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ecb77fa96ceda9cae88015bfe3293ffe19006159
Console is utf-8 by default
author Samuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 3 Jan 2008 16:17:54 +0000 (16:17 +0000)
committer Linus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 3 Jan 2008 20:06:40 +0000 (12:06 -0800)
I have stated the obvious reason to include support for consolefonts: when one does not use them from the beginning but only from rc.conf, and when the font size differs therein, the text that came before consolefont was activated from rc.sysinit disappears. Try it, it's easy: set it to ter-v12n and see what happens. (You might need the terminus package).
I'd gladly send in a patch, but I don't know how to make this work. I am curious about what has changed after the boot process goes from initramfs (where setfont does not work with a non-unicode font - it says 'bad file length') to rc.sysinit where setfont obviously does work. Might it be that setfont is loaded too soon, i.e. before the appropriate framebuffer device has been loaded?
As a possible aside, it seems that ubuntu has either switched, or added the option, to use console-tools instead of kbd. And it seems like Karol's link might be of help.
> By the way, it's odd that previous text does not disappear for you, karol. I am using the vesa line "vga=795" in my boot options.
I use KMS atm and thus I don't use any vga options.
That'd cover all bases, wouldn't it?
I think that was the original question.
I'm not a dev and it's easier for me to rename some files than to patch mkinitcpio. I've done some "research", posted a bunch of links. I don't think I can provide anything more. Take a look, take action. Or not.
If one changes the psfu.gz to psf.gz, or if one copies the font to ter-v12n.psf.gz, you get an error: setfont: input file: bad length.
But why would you do that?
"$CONSOLEFONT".psf*.gz would mean that both psf.gz and psfu.gz are OK.
>Renaming /usr/share/kbd/consolefonts/ter-116n.psf.gz to ter-116n.psfu.gz works for me.
This wouldn't be necessary anymore.
I'm playing with the hook at the moment, be patient.
I think that /dev/console might be the culprit; the consolefont hook sets it to there while rc.sysinit sets the fonts to /dev/tty and /dev/tty[0-9]* which are nonexistent on the initramfs.
setfont from busybox seems to have problems with some fonts.
I get "bad length" error only for terminus, for other psf fonts I get "KDFONTOP: invalid argument".
Attached are two consolefont patches (initcpio install and hooks) that solve this bug.
hooks-consolefont.patch (0.6 KiB)
I mean - what if user has /usr on a separate partition?
It's not wise to do such tricks just for eye candy.
Perhaps by tuning the config of mkinitcpio-busybox it is possible to add more font support.
For example, according to http://git.busybox.net/busybox/commit/?id=8ce1dc03c1b2b61e51527b987579c09c991cc4b2
there are some interesting options, however they are totally missing (not even commented) in the config of mkinitcpio-busybox.
Roman, the commit you pointed to is in the master branch of busybox, it will be in the 1.17 release. We could backport that commit to our busybox 1.16.1 build, maybe Mark's patch will then work with busybox's setfont as well. If that works, that is the way to go, if not I will apply Mark's patch as he posted it above.
In addition, for proper non-UTF8 console in initramfs we should also add CONSOLEMAP support.
I can try to build the patched busybox for you tonight, but the tests and enhancements to the hooks have to be made by Mark or you.
install-consolefont.patch (1.5 KiB)
[1] http://dev.archlinux.org/~thomas/mkinitcpio/
[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43987
[1] http://dev.archlinux.org/~thomas/mkinitcpio/
install-consolefont.patch (1.4 KiB)
This looks good. Thanks for putting your time and effort into this issue.
Kind regards,
-Mark
FONT=ter-v32n
My mkinitcpio.conf has:
MODULES="i915"
HOOKS="consolefont ..."
And when I boot I get the same error (setfont: input file: bad length) and the small font persists until much further in the boot sequence (systemd-vconsole-setup).
Note that if I add
BINARIES="/usr/bin/setfont"
to mkinitcpio.conf, then it works fine. I think the intent of this bug fix was to work with non-unicode fonts, but if that isn't the case, then it's fine to leave the bug closed.
At any rate I appreciate that the hook finds my .psf (as opposed to .psfu) file and makes everything work so long as I override the busybox setfont utility, so this is low priority.