]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(i18n): do not fail if FONT in /etc/vconsole.conf has the file extension
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 9 Sep 2022 11:11:14 +0000 (13:11 +0200)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 26 Sep 2022 09:47:31 +0000 (09:47 +0000)
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

index 6fd5fd433eaa95cc08fc97e78716633bb335cc14..ac456112fc288ef3cd2000cd8795411940c145f5 100755 (executable)
@@ -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