i18n: introduce i18n_install_all, to install everything

if i18n_install_all is set to "yes", then install all keyboard layouts
and fonts regardless of the hostonly setting.

This way, people can switch keyboard layouts, without having to recreate
the initramfs.
master
Harald Hoyer 2013-12-05 16:42:05 +01:00
parent c21c4dc2b4
commit 45845cb6a5
3 changed files with 30 additions and 16 deletions

View File

@ -122,10 +122,10 @@ If chrooted to another root other than the real root device, use --fstab and pro
*kernel_only=*"__{yes|no}__":: *kernel_only=*"__{yes|no}__"::
Only install kernel drivers and firmware files. (default=no) Only install kernel drivers and firmware files. (default=no)


*no_kernel=*"{yes|no}":: *no_kernel=*"__{yes|no}__"::
Do not install kernel drivers and firmware files (default=no) Do not install kernel drivers and firmware files (default=no)


*acpi_override=*"{yes|no}":: *acpi_override=*"__{yes|no}__"::
[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! + [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
Override BIOS provided ACPI tables. For further documentation read Override BIOS provided ACPI tables. For further documentation read
Documentation/acpi/initrd_table_override.txt in the kernel sources. Documentation/acpi/initrd_table_override.txt in the kernel sources.
@ -158,6 +158,16 @@ If chrooted to another root other than the real root device, use --fstab and pro
*show_modules=*"__{yes|no}__":: *show_modules=*"__{yes|no}__"::
Print the name of the included modules to standard output during build. Print the name of the included modules to standard output during build.


*i18n_vars="__<variable mapping>__"::
Distribution specific variable mapping.
See dracut/modules.d/10i18n/README for a detailed description.

*i18n_default_font=*"__<fontname>__"::
The font <fontname> to install, if not specified otherwise. Default is "LatArCyrHeb-16".

*i18n_install_all=*"__{yes|no}__"::
Install everything regardless of generic or hostonly mode.

Files Files
----- -----
_/etc/dracut.conf_:: _/etc/dracut.conf_::

View File

@ -3,6 +3,7 @@
# i18n # i18n
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP" i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
i18n_default_font="latarcyrheb-sun16" i18n_default_font="latarcyrheb-sun16"
i18n_install_all="yes"
stdloglvl=3 stdloglvl=3
sysloglvl=5 sysloglvl=5
install_items+=" vi /etc/virc ps grep cat rm " install_items+=" vi /etc/virc ps grep cat rm "

View File

@ -21,15 +21,11 @@ depends() {
# called by dracut # called by dracut
install() { install() {
if dracut_module_included "systemd"; then if dracut_module_included "systemd"; then
[[ -f /etc/vconsole.conf ]] || return 0
unset FONT unset FONT
unset KEYMAP unset KEYMAP
. /etc/vconsole.conf [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
# if vconsole.conf has no settings, do not include anything
[[ $FONT ]] || [[ $KEYMAP ]] || return 0
fi fi


inst_multiple -o $systemdutildir/systemd-vconsole-setup
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}" DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
I18N_CONF="/etc/locale.conf" I18N_CONF="/etc/locale.conf"
@ -213,10 +209,20 @@ install() {
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
fi fi


mksubdirs ${initdir}${I18N_CONF} if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
mksubdirs ${initdir}${VCONFIG_CONF} inst_simple ${I18N_CONF}
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} else
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} mksubdirs ${initdir}${I18N_CONF}
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
fi

if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
inst_simple ${VCONFIG_CONF}
else
mksubdirs ${initdir}${VCONFIG_CONF}
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
fi

return 0 return 0
} }


@ -240,16 +246,13 @@ install() {
return 0 return 0
} }


if checks if checks; then
then
install_base install_base


if [[ ${hostonly} ]] if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} ]]; then
then
install_local_i18n || install_all_kbd install_local_i18n || install_all_kbd
else else
install_all_kbd install_all_kbd
fi fi
fi fi
} }