From 61c9081a83d3bfcf8a96207e7b0d86b8c705c5dc Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:56:19 +0100 Subject: [PATCH] 10i18n: added upstream patches to fix adding required includes for keymaps and other fix for font [release 057-3mamba;Fri Sep 30 2022] --- ...am-add_required_includes_for_keymaps.patch | 28 ++++++++++++++++ ..._fail_if_FONT_has_the_file_extension.patch | 33 +++++++++++++++++++ dracut.spec | 11 +++++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 dracut-057-upstream-add_required_includes_for_keymaps.patch create mode 100644 dracut-057-upstream-dont_fail_if_FONT_has_the_file_extension.patch diff --git a/dracut-057-upstream-add_required_includes_for_keymaps.patch b/dracut-057-upstream-add_required_includes_for_keymaps.patch new file mode 100644 index 0000000..2689ef6 --- /dev/null +++ b/dracut-057-upstream-add_required_includes_for_keymaps.patch @@ -0,0 +1,28 @@ +From fe8fa2b0cadbb33e27c8dd8b5851548dcd65835c Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Mon, 27 Jun 2022 13:19:41 +0200 +Subject: [PATCH] fix(i18n): add required includes for keymaps + +Commit https://github.com/dracutdevs/dracut/commit/f3441cc7 removed shell +options but didn't adapt all the code that requires nullglob and globstar. +This caused the initrd to be generated without the required includes for +keymaps. +--- + modules.d/10i18n/module-setup.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index 35bda36fb..6fd5fd433 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -63,7 +63,9 @@ install() { + readarray -t INCLUDES < <("$CMD" '^include ' "$MAP" | while read -r _ a _ || [ -n "$a" ]; do echo "${a//\"/}"; done) + + for INCL in "${INCLUDES[@]}"; do +- for FN in "$dracutsysrootdir""${kbddir}"/keymaps/**/"$INCL"*; do ++ local -a FNS ++ mapfile -t -d '' FNS < <(find "${dracutsysrootdir}${kbddir}"/keymaps/ -type f -name "${INCL}*" -print0) ++ for FN in "${FNS[@]}"; do + [[ -f $FN ]] || continue + [[ -v KEYMAPS["$FN"] ]] || findkeymap "$FN" + done diff --git a/dracut-057-upstream-dont_fail_if_FONT_has_the_file_extension.patch b/dracut-057-upstream-dont_fail_if_FONT_has_the_file_extension.patch new file mode 100644 index 0000000..42ef046 --- /dev/null +++ b/dracut-057-upstream-dont_fail_if_FONT_has_the_file_extension.patch @@ -0,0 +1,33 @@ +From e1de5bd2d711df2c6814a3c3ab8472cdb4de9101 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Fri, 9 Sep 2022 13:11:14 +0200 +Subject: [PATCH] fix(i18n): do not fail if FONT in /etc/vconsole.conf has the + file extension + +If the FONT option defined in /etc/vconsole.conf refers to a file with its +extension, not just the file name, dracut should not fail and install it. The +systemd-vconsole-setup service ends up calling setfont, which supports both file +names and files with extensions. +--- + modules.d/10i18n/module-setup.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index 6fd5fd433..ac456112f 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -222,8 +222,12 @@ install() { + inst_opt_decompress "${kbddir}"/consolefonts/"${DEFAULT_FONT}".* + + if [[ ${FONT} ]] && [[ ${FONT} != "${DEFAULT_FONT}" ]]; then +- FONT=${FONT%.psf*} +- inst_opt_decompress "${kbddir}"/consolefonts/"${FONT}".* ++ if [[ -f "${kbddir}"/consolefonts/"${FONT}" ]]; then ++ inst_opt_decompress "${kbddir}"/consolefonts/"${FONT}" ++ else ++ FONT=${FONT%.psf*} ++ inst_opt_decompress "${kbddir}"/consolefonts/"${FONT}".* ++ fi + fi + + if [[ ${FONT_MAP} ]]; then diff --git a/dracut.spec b/dracut.spec index 6c8bba7..c006739 100644 --- a/dracut.spec +++ b/dracut.spec @@ -1,6 +1,6 @@ Name: dracut Version: 057 -Release: 2mamba +Release: 3mamba Summary: Generic, modular initramfs generation tool that can be used across various distributions Group: System/Kernel and Hardware Vendor: openmamba @@ -27,6 +27,8 @@ Patch23: dracut-044-bash-4.4.patch Patch24: dracut-049-squash-live-systemd-240.patch Patch25: dracut-055-bluetooth-lib64-fix.patch Patch26: dracut-057-i18n-fix-adding-keymaps-includes.patch +Patch27: dracut-057-upstream-add_required_includes_for_keymaps.patch +Patch28: dracut-057-upstream-dont_fail_if_FONT_has_the_file_extension.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -115,7 +117,9 @@ This package conatins extra optional modules for dracut. %ifarch x86_64 aarch64 %patch25 -p1 %endif -%patch26 -p1 +#%patch26 -p1 +%patch27 -p1 -b .upstream-add_required_includes_for_keymaps +%patch28 -p1 -b .upstream-dont_fail_if_FONT_has_the_file_extension #chmod +x modules.d/99squash-live/* @@ -430,6 +434,9 @@ fi #%doc NEWS README README.generic README.kernel README.modules TODO %changelog +* Fri Sep 30 2022 Silvan Calarco 057-3mamba +- 10i18n: added upstream patches to fix adding required includes for keymaps and other fix for font + * Sat Jul 02 2022 Silvan Calarco 057-2mamba - added a patch to fix adding keymap includes causing systemd-vconsole startup error with host-only initramfs