i18n: do not use systemd-vconsole-setup

systemd-vconsole-setup was not designed to be run from udevd.
It checks locale environment to decide, whether UNICODE should
be enabled or disabled. Normally environment is setup by
systemd; but the only environment available in udev rules is
those from device properties. It means systemd-vconsole-setup
always assumes default C locale and disables UNICODE.

Revert to using built-in console_init which explicitly
imports locale settings from /etc/vconsole.conf. Alternative
is to revert 6545b9d7 and call console_init directly :)

Additionally patch fixes console_init to use new namespace as
well as ensures that default font is always installed.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
master
Andrey Borzenkov 2010-11-07 00:14:49 +03:00 committed by Harald Hoyer
parent dbcc4e94c5
commit 161da365e2
2 changed files with 13 additions and 15 deletions

View File

@ -4,7 +4,7 @@


[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf [ -e /etc/vconsole.conf ] && . /etc/vconsole.conf


DEFAULT_SYSFONT=LatArCyrHeb-16 DEFAULT_FONT=LatArCyrHeb-16
DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap


set_keyboard() { set_keyboard() {
@ -42,11 +42,11 @@ set_keymap() {
set_font() { set_font() {
local dev=$1; local trans=''; local uni='' local dev=$1; local trans=''; local uni=''


[ -z "${SYSFONT}" ] && SYSFONT=${DEFAULT_SYSFONT} [ -z "${FONT}" ] && FONT=${DEFAULT_FONT}
[ -n "${CONTRANS}" ] && trans="-m ${CONTRANS}" [ -n "${FONT_MAP}" ] && trans="-m ${FONT_MAP}"
[ -n "${UNIMAP}" ] && uni="-u ${UNIMAP}" [ -n "${FONT_UNIMAP}" ] && uni="-u ${FONT_UNIMAP}"


setfont ${SYSFONT} -C ${dev} ${trans} ${uni} setfont ${FONT} -C ${dev} ${trans} ${uni}
} }


dev_close() { dev_close() {

View File

@ -73,13 +73,7 @@ gather_vars() {
install_base() { install_base() {
dracut_install setfont loadkeys kbd_mode stty dracut_install setfont loadkeys kbd_mode stty


if [ -x /lib/systemd/systemd-vconsole-setup ]; then inst ${moddir}/console_init /lib/udev/console_init
dracut_install /lib/systemd/systemd-vconsole-setup
inst_dir /lib/udev
ln -s /lib/systemd/systemd-vconsole-setup "${initdir}/lib/udev/console_init"
else
inst ${moddir}/console_init /lib/udev/console_init
fi
inst_rules ${moddir}/10-console.rules inst_rules ${moddir}/10-console.rules
inst_hook cmdline 20 "${moddir}/parse-i18n.sh" inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
} }
@ -123,9 +117,13 @@ install_local_i18n() {


inst_opt_decompress ${KEYMAPS} inst_opt_decompress ${KEYMAPS}


[[ ${FONT} ]] || FONT=${DEFAULT_FONT} inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*
FONT=${FONT%.psf*}
inst_opt_decompress ${kbddir}/consolefonts/${FONT}.* if [[ ${FONT} ]]
then
FONT=${FONT%.psf*}
inst_opt_decompress ${kbddir}/consolefonts/${FONT}.*
fi


if [[ ${FONT_MAP} ]] if [[ ${FONT_MAP} ]]
then then