summaryrefslogtreecommitdiffstats
path: root/0059-i18n-introduce-i18n_install_all-to-install-everythin.patch
blob: bd6562d4d7a435737159757bf09939e3fb0810df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
From 45845cb6a5f1100fa4163e25c0681afceb838b64 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 5 Dec 2013 16:42:05 +0100
Subject: [PATCH] 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.
---
 dracut.conf.5.asc                 | 14 ++++++++++++--
 dracut.conf.d/fedora.conf.example |  1 +
 modules.d/10i18n/module-setup.sh  | 31 +++++++++++++++++--------------
 3 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
index c9c854a..30b7e03 100644
--- a/dracut.conf.5.asc
+++ b/dracut.conf.5.asc
@@ -122,10 +122,10 @@ If chrooted to another root other than the real root device, use --fstab and pro
 *kernel_only=*"__{yes|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)
 
-*acpi_override=*"{yes|no}"::
+*acpi_override=*"__{yes|no}__"::
     [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
     Override BIOS provided ACPI tables. For further documentation read
     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}__"::
     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
 -----
 _/etc/dracut.conf_::
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index 1a56a86..495e8fb 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -3,6 +3,7 @@
 # i18n
 i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
 i18n_default_font="latarcyrheb-sun16"
+i18n_install_all="yes"
 stdloglvl=3
 sysloglvl=5
 install_items+=" vi /etc/virc ps grep cat rm "
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index f07b148..fcb18d1 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -21,15 +21,11 @@ depends() {
 # called by dracut
 install() {
     if dracut_module_included "systemd"; then
-        [[ -f /etc/vconsole.conf ]] || return 0
         unset FONT
         unset KEYMAP
-        . /etc/vconsole.conf
-        # if vconsole.conf has no settings, do not include anything
-        [[ $FONT ]] || [[ $KEYMAP ]] || return 0
+        [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
     fi
 
-    inst_multiple -o $systemdutildir/systemd-vconsole-setup
     KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
     DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
     I18N_CONF="/etc/locale.conf"
@@ -213,10 +209,20 @@ install() {
             inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
         fi
 
-        mksubdirs ${initdir}${I18N_CONF}
-        mksubdirs ${initdir}${VCONFIG_CONF}
-        print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
-        print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
+        if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
+            inst_simple ${I18N_CONF}
+        else
+            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
     }
 
@@ -240,16 +246,13 @@ install() {
         return 0
     }
 
-    if checks
-    then
+    if checks; then
         install_base
 
-        if [[ ${hostonly} ]]
-        then
+        if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} ]]; then
             install_local_i18n || install_all_kbd
         else
             install_all_kbd
         fi
     fi
 }
-