From: Adam Williamson Date: Mon, 25 Dec 2023 22:48:27 +0000 (-0800) Subject: Fix checks for existence of vars set by fc-match X-Git-Tag: 23.360.11~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fe900a4f3308e31f94efa286898fb511d2d46db;p=thirdparty%2Fplymouth.git 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 --- 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