Blame SOURCES/0054-i18n-introduce-i18n_install_all-to-install-everythin.patch

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