From 60518331f56ea5d994abb6717e98166c10bab6a4 Mon Sep 17 00:00:00 2001 From: Thomas Blume Date: Mon, 22 Jan 2024 10:28:00 +0100 Subject: [PATCH 1/5] fix(i18n): handle symlinked keymap handle keymaps that are symlinks to others, for example: KEYMAP=de-nodeadkeys in vconsole.conf is: lrwxrwxrwx 1 root root 20 17. Mai 2023 /usr/share/kbd/keymaps/xkb/de-nodeadkeys.map.gz -> at-nodeadkeys.map.gz --- modules.d/10i18n/module-setup.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh index ac456112fc..ffd2f2c554 100755 --- a/modules.d/10i18n/module-setup.sh +++ b/modules.d/10i18n/module-setup.sh @@ -44,7 +44,7 @@ install() { MAPNAME=${1%.map*} mapfile -t -d '' MAPS < <( - find "${dracutsysrootdir}${kbddir}"/keymaps/ -type f \( -name "${MAPNAME}" -o -name "${MAPNAME}.map*" \) -print0 + find "${dracutsysrootdir}${kbddir}"/keymaps/ -type f,l \( -name "${MAPNAME}" -o -name "${MAPNAME}.map*" \) -print0 ) fi @@ -160,6 +160,7 @@ install() { install_local_i18n() { local map + local maplink # shellcheck disable=SC2086 eval "$(gather_vars ${i18n_vars})" @@ -216,7 +217,19 @@ install() { done for keymap in "${!KEYMAPS[@]}"; do - inst_opt_decompress "${keymap}" + if [[ -L ${keymap} ]]; then + maplink=$(readlink -f "${keymap}") + # skip symlinked directories + [[ -d ${maplink} ]] && continue + + inst_opt_decompress "${maplink}" + # create new symlink to decompressed keymap + maplink=${maplink%.gz} + keymap=${keymap%.gz} + ln -srn "${initdir}${maplink#"$dracutsysrootdir"}" "${initdir}${keymap#"$dracutsysrootdir"}" + else + inst_opt_decompress "${keymap}" + fi done inst_opt_decompress "${kbddir}"/consolefonts/"${DEFAULT_FONT}".* From d801c7dfb078e0e91316e2cfba338f6294f178cc Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 24 Jan 2024 15:27:39 +0100 Subject: [PATCH 2/5] fix(dracut-systemd): replace `rd.udev.log-priority` with `rd.udev.log_level` `rd.udev.log-priority` is deprecated since systemd-v247 (https://github.com/systemd/systemd/commit/64a3494c) Also, fix deprecation warning not being displayed for `rdudevinfo` and `rdudevdebug`. --- modules.d/98dracut-systemd/dracut-cmdline.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh index 13f91a1106..d2919e18b7 100755 --- a/modules.d/98dracut-systemd/dracut-cmdline.sh +++ b/modules.d/98dracut-systemd/dracut-cmdline.sh @@ -17,8 +17,10 @@ fi info "Using kernel command line parameters:" "$(getcmdline)" -getargbool 0 rd.udev.log-priority=info -d rd.udev.info -d -n -y rdudevinfo && echo 'udev_log="info"' >> /etc/udev/udev.conf -getargbool 0 rd.udev.log-priority=debug -d rd.udev.debug -d -n -y rdudevdebug && echo 'udev_log="debug"' >> /etc/udev/udev.conf +getargbool 0 rd.udev.log_level=info -d rd.udev.log-priority=info -d rd.udev.info -d -y rdudevinfo \ + && echo 'udev_log="info"' >> /etc/udev/udev.conf +getargbool 0 rd.udev.log_level=debug -d rd.udev.log-priority=debug -d rd.udev.debug -d -y rdudevdebug \ + && echo 'udev_log="debug"' >> /etc/udev/udev.conf source_conf /etc/conf.d From 3cbf46ef460ada7f7fd31df0fc2aa6da1294436e Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 7 Feb 2024 11:48:57 +0100 Subject: [PATCH 3/5] fix(i18n): handle keymap includes with `--sysroot` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 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 ffd2f2c554..960c41ddb8 100755 --- a/modules.d/10i18n/module-setup.sh +++ b/modules.d/10i18n/module-setup.sh @@ -38,7 +38,7 @@ install() { local CMD local FN - if [[ -f $dracutsysrootdir$1 ]]; then + if [[ -f $1 ]]; then MAPS=("$1") else MAPNAME=${1%.map*} From 3a46a5264370743e276be7904f30de470d596408 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 7 Feb 2024 11:49:14 +0100 Subject: [PATCH 4/5] fix(dracut-init.sh): handle decompress with `--sysroot` Remove `$dracutsysrootdir` from the file path passed to the decompress command, otherwise the path is wrong and the file is not decompressed in the temporary directory where the initramfs is being built. E.g.: ``` dracut[I]: *** Including module: i18n *** gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/i386/include/euro1.map.gz: No such file or directory gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory gzip: /var/tmp/dracut.6Iqygd/initramfs/.snapshots/12/snapshot/usr/share/kbd/keymaps/xkb/us.map.gz: No such file or directory ``` --- dracut-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-init.sh b/dracut-init.sh index f56f6fc2f8..273271e3d8 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -737,7 +737,7 @@ inst_decompress() { inst_simple "${_src}" # Decompress with chosen tool. We assume that tool changes name e.g. # from 'name.gz' to 'name'. - ${_cmd} "${initdir}${_src}" + ${_cmd} "${initdir}${_src#"$dracutsysrootdir"}" done } From 8f9338a77118ee929f36abb282aeac2cff5f33c3 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Fri, 9 Feb 2024 14:14:50 +0100 Subject: [PATCH 5/5] chore(suse): update SUSE maintainers doc --- suse/README.susemaint | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/suse/README.susemaint b/suse/README.susemaint index 9ad04aa901..0b9cc234d1 100644 --- a/suse/README.susemaint +++ b/suse/README.susemaint @@ -329,4 +329,8 @@ PR Commit message 2611 fix(livenet): propagate error code 2611 fix(livenet): check also `content-length` from live image header 2611 fix(livenet): split `imgsize` calculation to avoid misleading error message +2613 fix(i18n): handle symlinked keymap +2614 fix(dracut-systemd): replace `rd.udev.log-priority` with `rd.udev.log_level` +2618 fix(i18n): handle keymap includes with `--sysroot` +2618 fix(dracut-init.sh): handle decompress with `--sysroot`