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

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