From 2fe900a4f3308e31f94efa286898fb511d2d46db Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 25 Dec 2023 14:48:27 -0800 Subject: [PATCH] Fix checks for existence of vars set by fc-match 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 --- scripts/plymouth-populate-initrd.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in index 0c391523..20614a22 100755 --- a/scripts/plymouth-populate-initrd.in +++ b/scripts/plymouth-populate-initrd.in @@ -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