]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Fix checks for existence of vars set by fc-match
authorAdam Williamson <awilliam@redhat.com>
Mon, 25 Dec 2023 22:48:27 +0000 (14:48 -0800)
committerAdam Williamson <awilliam@redhat.com>
Mon, 25 Dec 2023 22:52:54 +0000 (14:52 -0800)
The first line here checked for the wrong variable and is a dupe
from two lines earlier anyway, and the second line isn't guarded
at all, which seems to cause the weird failure we've been seeing
in openQA testing.

Also add a couple more existence checks for the same variables
later.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
scripts/plymouth-populate-initrd.in

index 0c3915236fe74c349e8f3847049faa1b475cc2cc..20614a2251496dd7faa8d4d37ef5d78e9b6a805a 100755 (executable)
@@ -599,15 +599,14 @@ fi
 DEFAULT_FONT=$(fc-match -f %{file} 2> /dev/null)
 [ ! -z "$DEFAULT_FONT" ] && inst "$DEFAULT_FONT" $INITRDDIR
 DEFAULT_MONOSPACE_FONT=$(fc-match -f %{file} monospace 2> /dev/null)
-[ ! -z "$DEFAULT_MONOSPACE_FONT" ] && inst "$DEFAULT_FONT" $INITRDDIR
-inst "$DEFAULT_MONOSPACE_FONT" $INITRDDIR
+[ ! -z "$DEFAULT_MONOSPACE_FONT" ] && inst "$DEFAULT_MONOSPACE_FONT" $INITRDDIR
 
 if [ -f "${PLYMOUTH_PLUGIN_PATH}/label-freetype.so" ]; then
      inst ${PLYMOUTH_PLUGIN_PATH}/label-freetype.so $INITRDDIR
      # The label-freetype plugin expects it at this location
      mkdir -p $INITRDDIR/usr/share/fonts
-     ln -s "$DEFAULT_FONT" $INITRDDIR/usr/share/fonts/Plymouth.ttf
-     ln -s "$DEFAULT_MONOSPACE_FONT" $INITRDDIR/usr/share/fonts/Plymouth-monospace.ttf
+     [ ! -z "$DEFAULT_FONT" ] && ln -s "$DEFAULT_FONT" $INITRDDIR/usr/share/fonts/Plymouth.ttf
+     [ ! -z "$DEFAULT_MONOSPACE_FONT" ] && ln -s "$DEFAULT_MONOSPACE_FONT" $INITRDDIR/usr/share/fonts/Plymouth-monospace.ttf
 fi
 
 if [ -L ${PLYMOUTH_SYSROOT}${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ]; then