18971c
From dac45f997e6868ffba23610167c8bcb7476b0f96 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Thu, 5 Dec 2013 16:42:05 +0100
18971c
Subject: [PATCH] i18n: introduce i18n_install_all, to install everything
18971c
18971c
if i18n_install_all is set to "yes", then install all keyboard layouts
18971c
and fonts regardless of the hostonly setting.
18971c
18971c
This way, people can switch keyboard layouts, without having to recreate
18971c
the initramfs.
18971c
---
18971c
 dracut.conf.5.asc                 | 14 ++++++++++++--
18971c
 dracut.conf.d/fedora.conf.example |  1 +
18971c
 modules.d/10i18n/module-setup.sh  | 31 +++++++++++++++++--------------
18971c
 3 files changed, 30 insertions(+), 16 deletions(-)
18971c
18971c
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
18971c
index c9c854a9..30b7e030 100644
18971c
--- a/dracut.conf.5.asc
18971c
+++ b/dracut.conf.5.asc
18971c
@@ -122,10 +122,10 @@ If chrooted to another root other than the real root device, use --fstab and pro
18971c
 *kernel_only=*"__{yes|no}__"::
18971c
     Only install kernel drivers and firmware files. (default=no)
18971c
 
18971c
-*no_kernel=*"{yes|no}"::
18971c
+*no_kernel=*"__{yes|no}__"::
18971c
     Do not install kernel drivers and firmware files (default=no)
18971c
 
18971c
-*acpi_override=*"{yes|no}"::
18971c
+*acpi_override=*"__{yes|no}__"::
18971c
     [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
18971c
     Override BIOS provided ACPI tables. For further documentation read
18971c
     Documentation/acpi/initrd_table_override.txt in the kernel sources.
18971c
@@ -158,6 +158,16 @@ If chrooted to another root other than the real root device, use --fstab and pro
18971c
 *show_modules=*"__{yes|no}__"::
18971c
     Print the name of the included modules to standard output during build.
18971c
 
18971c
+*i18n_vars="__<variable mapping>__"::
18971c
+    Distribution specific variable mapping.
18971c
+    See dracut/modules.d/10i18n/README for a detailed description.
18971c
+
18971c
+*i18n_default_font=*"__<fontname>__"::
18971c
+    The font <fontname> to install, if not specified otherwise. Default is "LatArCyrHeb-16".
18971c
+
18971c
+*i18n_install_all=*"__{yes|no}__"::
18971c
+    Install everything regardless of generic or hostonly mode.
18971c
+
18971c
 Files
18971c
 -----
18971c
 _/etc/dracut.conf_::
18971c
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
18971c
index 1a56a864..495e8fb3 100644
18971c
--- a/dracut.conf.d/fedora.conf.example
18971c
+++ b/dracut.conf.d/fedora.conf.example
18971c
@@ -3,6 +3,7 @@
18971c
 # i18n
18971c
 i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
18971c
 i18n_default_font="latarcyrheb-sun16"
18971c
+i18n_install_all="yes"
18971c
 stdloglvl=3
18971c
 sysloglvl=5
18971c
 install_items+=" vi /etc/virc ps grep cat rm "
18971c
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
18971c
index 2a837280..413ee123 100755
18971c
--- a/modules.d/10i18n/module-setup.sh
18971c
+++ b/modules.d/10i18n/module-setup.sh
18971c
@@ -18,15 +18,11 @@ depends() {
18971c
 
18971c
 install() {
18971c
     if dracut_module_included "systemd"; then
18971c
-        [[ -f /etc/vconsole.conf ]] || return 0
18971c
         unset FONT
18971c
         unset KEYMAP
18971c
-        . /etc/vconsole.conf
18971c
-        # if vconsole.conf has no settings, do not include anything
18971c
-        [[ $FONT ]] || [[ $KEYMAP ]] || return 0
18971c
+        [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
18971c
     fi
18971c
 
18971c
-    inst_multiple -o $systemdutildir/systemd-vconsole-setup
18971c
     KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
18971c
     DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
18971c
     I18N_CONF="/etc/locale.conf"
18971c
@@ -207,10 +203,20 @@ install() {
18971c
             inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
18971c
         fi
18971c
 
18971c
-        mksubdirs ${initdir}${I18N_CONF}
18971c
-        mksubdirs ${initdir}${VCONFIG_CONF}
18971c
-        print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
18971c
-        print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
18971c
+        if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
18971c
+            inst_simple ${I18N_CONF}
18971c
+        else
18971c
+            mksubdirs ${initdir}${I18N_CONF}
18971c
+            print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
18971c
+        fi
18971c
+
18971c
+        if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
18971c
+            inst_simple ${VCONFIG_CONF}
18971c
+        else
18971c
+            mksubdirs ${initdir}${VCONFIG_CONF}
18971c
+            print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
18971c
+        fi
18971c
+
18971c
         return 0
18971c
     }
18971c
 
18971c
@@ -234,16 +240,13 @@ install() {
18971c
         return 0
18971c
     }
18971c
 
18971c
-    if checks
18971c
-    then
18971c
+    if checks; then
18971c
         install_base
18971c
 
18971c
-        if [[ ${hostonly} ]]
18971c
-        then
18971c
+        if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} ]]; then
18971c
             install_local_i18n || install_all_kbd
18971c
         else
18971c
             install_all_kbd
18971c
         fi
18971c
     fi
18971c
 }
18971c
-