Blame 0059-i18n-introduce-i18n_install_all-to-install-everythin.patch

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