]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(i18n): handle keymap includes with `--sysroot`
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 7 Feb 2024 10:48:57 +0000 (11:48 +0100)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 12 Apr 2024 17:20:29 +0000 (13:20 -0400)
The results of `find "${dracutsysrootdir}${kbddir}"/keymaps/ -type f -name "${INCL}*" -print0`
are directly passed to `findkeymap` containing the `$dracutsysrootdir` path,
which causes that `[[ -f $dracutsysrootdir$1 ]]` evaluates to false because the
same path is prepended again, and the following `find` fails because `MAPNAME`
has an absolute path.

E.g., with `dracutsysrootdir=/.snapshots/9/snapshot`, for `MAPNAME=us` the
`INCLUDES` of `MAP=/.snapshots/9/snapshot/usr/share/kbd/keymaps/i386/qwerty/us.map.gz`
will pass `/.snapshots/9/snapshot/usr/share/kbd/keymaps/i386/include/qwerty-layout.inc` to
`findkeymap`.

```
dracut[I]: *** Including module: i18n ***
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?
```

modules.d/10i18n/module-setup.sh

index ffd2f2c554dbd7865e57947df5994372a5d4e9b6..960c41ddb8323a999bc43571cf9ce90d16af6a91 100755 (executable)
@@ -38,7 +38,7 @@ install() {
         local CMD
         local FN
 
-        if [[ -f $dracutsysrootdir$1 ]]; then
+        if [[ -f $1 ]]; then
             MAPS=("$1")
         else
             MAPNAME=${1%.map*}