]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
refactor(i18n): move code around to increase readability
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 4 Jan 2025 21:12:29 +0000 (16:12 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 4 Jan 2025 22:36:37 +0000 (17:36 -0500)
modules.d/10i18n/module-setup.sh

index 09e40df10e16bd51500c64570459e9c2d62a172c..b78d785aeb43f0fabe507b7dd5f5e0064f878ff8 100755 (executable)
@@ -117,18 +117,30 @@ install() {
     install_base() {
         inst_multiple setfont loadkeys kbd_mode stty
 
-        if ! dracut_module_included "systemd"; then
-            inst "${moddir}"/console_init.sh /lib/udev/console_init
-            inst_rules "${moddir}"/10-console.rules
-            inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
-        fi
-
         if [[ ${kbddir} != "/usr/share" ]]; then
             inst_dir /usr/share
             for _src in "${KBDSUBDIRS[@]}"; do
                 [ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
             done
         fi
+
+        if dracut_module_included "systemd"; then
+            # https://github.com/dracutdevs/dracut/issues/796
+            [[ -f $dracutsysrootdir${VCONFIG_CONF} ]] && inst_simple ${VCONFIG_CONF}
+
+            inst_rules 90-vconsole.rules
+
+            if [[ -e "$systemdsystemunitdir"/systemd-vconsole-setup.service ]]; then
+                inst_multiple -o \
+                    "$systemdutildir"/systemd-vconsole-setup \
+                    "$systemdsystemunitdir"/systemd-vconsole-setup.service \
+                    "$systemdsystemunitdir"/sysinit.target.wants/systemd-vconsole-setup.service
+            fi
+        else
+            inst "${moddir}"/console_init.sh /lib/udev/console_init
+            inst_rules "${moddir}"/10-console.rules
+            inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
+        fi
     }
 
     install_all_kbd() {
@@ -291,21 +303,6 @@ install() {
     if checks; then
         install_base
 
-        if dracut_module_included "systemd"; then
-            # https://github.com/dracutdevs/dracut/issues/796
-            [[ -f $dracutsysrootdir${VCONFIG_CONF} ]] && inst_simple ${VCONFIG_CONF}
-
-            inst_rules 90-vconsole.rules
-
-            if [[ -e "$systemdsystemunitdir"/systemd-vconsole-setup.service ]]; then
-                inst_multiple -o \
-                    "$systemdutildir"/systemd-vconsole-setup \
-                    "$systemdsystemunitdir"/systemd-vconsole-setup.service \
-                    "$systemdsystemunitdir"/sysinit.target.wants/systemd-vconsole-setup.service
-            fi
-
-        fi
-
         if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
             install_local_i18n || install_all_kbd
         else