Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 5c1bb304a26349fad0d8eaf2d0262d83 > files > 20

dracut-025-8.mga3.src.rpm

From 15d2d6ac016473b10423d53580dc32591c389eac Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Wed, 24 Apr 2013 10:16:50 +0100
Subject: [PATCH 512/514] Match .map* files before .inc files when looking for
 keymaps.

If an extra keymap is defined (UNIKEYMAP and GRP_TOGGLE) then
on some occasions, dracut will pick the .inc file rather than
the .map file which causes an error in the initrd:
  https://bugs.mageia.org/show_bug.cgi?id=9808

As we should favour the name sans any extension, we run that
one first, then run one that matches the *.map* pattern and finally
one that matches all files as before.

An alternative fix here would be to simply miss off the final find call
as tests run on my system suggest that this would be sufficient to find
all the necessary maps:

$ find /usr/lib/kbd/keymaps -type f | grep -vE "\.(inc|map.gz)$"
/usr/lib/kbd/keymaps/i386/qwerty/hypermap.m4
/usr/lib/kbd/keymaps/i386/qwerty/no-latin1.doc
/usr/lib/kbd/keymaps/include/compose.latin1
/usr/lib/kbd/keymaps/include/compose.latin2
/usr/lib/kbd/keymaps/include/compose.latin3
/usr/lib/kbd/keymaps/include/compose.8859_7
/usr/lib/kbd/keymaps/include/vim-compose.latin1
/usr/lib/kbd/keymaps/include/compose.latin
/usr/lib/kbd/keymaps/include/compose.latin4
/usr/lib/kbd/keymaps/include/compose.8859_8

In this case we want to exclude the .m4 and .doc files and when
searching for a map, we also want to ignore the .inc files. Those files
without an extension should be matched directly already by the first
find and thus everything is covered. .inc files would be included
by the include parsing of the parent map (in this case it's slightly
inefficient as both .inc and .map files may be included when a .inc
file may be sufficient.
---
 modules.d/10i18n/module-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 21b0c05..06587de 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -22,7 +22,7 @@ install() {
     findkeymap () {
         local MAP=$1
         [[ ! -f $MAP ]] && \
-            MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
+            MAP=$((find ${kbddir}/keymaps -type f -name $MAP; find ${kbddir}/keymaps -type f -name $MAP.map\*; find ${kbddir}/keymaps -type f -name $MAP.\*) | head -n1)
         [[ " $KEYMAPS " = *" $MAP "* ]] && return
         KEYMAPS="$KEYMAPS $MAP"
         case $MAP in
-- 
1.8.1.5