Skip to content

Commit

Permalink
sys-apps/systemd: sys-kernel/dracut: fix systemd-vconsole-setup run
Browse files Browse the repository at this point in the history
systemd-vconsole-setup needs the dracut i18n module so that
the binary loadkeys is present. The binary loadkeys comes from
the kbd package.

A custom dracut module patch for i18n was created, so that only the
default `us` keymap and font are installed, leading the size
increase to the minimum of around a few KB instead of 3MB.

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
  • Loading branch information
ader1990 committed Mar 14, 2024
1 parent 6b2771e commit fcfbf18
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ PATCHES=(
"${FILESDIR}"/050-change-network-dep-iscsi.patch
# Add required systemd 255 binary
"${FILESDIR}"/059-systemd-executor.patch
# Add systemd vconsole setup fix using i118n
"${FILESDIR}"/0001-systemd-initrd-install-only-keymap-required-by-syste.patch
)

src_configure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 6d7e4b88c21f45cf1695e4495004a12cacd58d0c Mon Sep 17 00:00:00 2001
From: Adrian Vladu <avladu@cloudbasesolutions.com>
Date: Thu, 7 Mar 2024 11:17:54 +0000
Subject: [PATCH] systemd: initrd: install only keymap required by
systemd-vconsole-setup

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
---
modules.d/10i18n/module-setup.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index d6688b47..516883be 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -4,7 +4,7 @@
check() {
[[ "$mount_needs" ]] && return 1

- require_binaries setfont loadkeys kbd_mode || return 1
+ require_binaries loadkeys || return 1

return 0
}
@@ -164,6 +164,10 @@ install() {
fi
shopt -q -u nocasematch

+ # install only one keymap: us
+ KEYMAP=us
+
+
# Gentoo user may have KEYMAP set to something like "-u pl2",
KEYMAP=${KEYMAP#-* }

@@ -267,10 +271,7 @@ install() {
inst_simple ${VCONFIG_CONF}
fi

- if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
- install_local_i18n || install_all_kbd
- else
- install_all_kbd
- fi
+ # install only one keyboard map
+ install_local_i18n
fi
}
--
2.43.0

0 comments on commit fcfbf18

Please sign in to comment.