plymouth/plymouth-set-default-theme-suse-branding.patch
Cliff Zhao bb83894fe8 Accepting request 917854 from home:qzhao:branches:Base:System
- Add plymouth-set-default-theme-suse-branding.patch: set plymouth's 
  default theme to openSUSE/SUSE branding assigned style to avoid 
  screen mass(bsc#1189613).
- Update plymouth.spec: Rearrange plymouth sub packages dependencies 
  to avoid installation failures due to a race installation state 
  which will leading theme display fault(1189613).

OBS-URL: https://build.opensuse.org/request/show/917854
OBS-URL: https://build.opensuse.org/package/show/Base:System/plymouth?expand=0&rev=307
2021-09-10 05:12:32 +00:00

147 lines
6.5 KiB
Diff

diff -Nura plymouth-0.9.5~git20210406.e554475/scripts/plymouth-set-default-theme.in plymouth-0.9.5~git20210406.e554475_new/scripts/plymouth-set-default-theme.in
--- plymouth-0.9.5~git20210406.e554475/scripts/plymouth-set-default-theme.in 2021-09-07 21:20:35.469101952 +0800
+++ plymouth-0.9.5~git20210406.e554475_new/scripts/plymouth-set-default-theme.in 2021-09-07 21:51:07.618708601 +0800
@@ -6,6 +6,7 @@
[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@"
[ -z "$PLYMOUTH_CONFDIR" ] && PLYMOUTH_CONFDIR="@PLYMOUTH_CONF_DIR@"
[ -z "$PLYMOUTH_POLICYDIR" ] && PLYMOUTH_POLICYDIR="@PLYMOUTH_POLICY_DIR@"
+[ -z "$OS" ] && OS=`cat /etc/os-release |grep ^NAME= |cut -d'=' -f2`
if [ -z "$PLYMOUTH_PLUGIN_PATH" ]; then
if [ -z "$LIB" ]; then
PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)"
@@ -56,27 +57,27 @@
')
}
-function get_default_theme ()
+function get_current_theme ()
{
- if [ -f /etc/plymouth/plymouthd.conf ]; then
+ if [ -z "$THEME_NAME" -a -r "${PLYMOUTH_CONFDIR}/plymouthd.conf" ]; then
THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_CONFDIR}/plymouthd.conf)
- elif [ -f /usr/share/plymouth/plymouthd.defaults ]; then
- THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defaults)
fi
- if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" ]; then
+ if [ -z "$THEME_NAME" -a -r "${PLYMOUTH_POLICYDIR}/plymouthd.defaults" ]; then
THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_POLICYDIR}/plymouthd.defaults)
fi
- if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" \
- -a -L "${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth" ]; then
- THEME_NAME=$(basename "$(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth)" .plymouth)
- fi
- if [ -z "$THEME_NAME" -o ! -r "${PLYMOUTH_DATADIR}/plymouth/themes/$THEME_NAME/$THEME_NAME.plymouth" ]; then
- THEME_NAME="text"
+ if [ -n "$THEME_NAME" ] ; then
+ if [ $DO_INITRD_REBUILD -eq 0 ]; then
+ echo $THEME_NAME
+ fi
+ return 0;
+ else
+ echo "Failed: No default theme found."
+ return 1;
fi
- echo $THEME_NAME
+
}
DO_RESET=0
@@ -163,7 +164,7 @@
fi
if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $THEME_NAME ]; then
- get_default_theme
+ get_current_theme
exit $?
fi
@@ -173,27 +174,30 @@
fi
if [ $DO_RESET -ne 0 ]; then
- if [ -f ${PLYMOUTH_CONFDIR}/plymouthd.conf ]; then
- sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf
- exit $?
- elif [ -f ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defauts ]; then
- cp ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defauts ${PLYMOUTH_CONFDIR}/plymouthd.conf
- sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf
- exit $?
- else
- exit 0
- fi
+ if [[ -z "$THEME_NAME" ]] && [[ "$OS" == "SLED" ]] || [[ "$OS" == "SLES" ]] ; then
+ THEME_NAME="SLE"
+
+ elif [[ -z "$THEME_NAME" ]] && [[ "$OS" == *"openSUSE Tumbleweed"* ]] ; then
+ THEME_NAME="bgrt"
+
+ elif [[ -z "$THEME_NAME" ]] && [[ "$OS" == *"openSUSE Leap"* ]] ; then
+ THEME_NAME="opensuse"
+ fi
+fi
+
+if [[ -z "$THEME_NAME" ]] ; then
+ get_current_theme
fi
if [ ! -e ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then
- echo "${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" >&2
+ echo "Failed: ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" >&2
exit 1
fi
MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
if [ ! -e ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so ]; then
- echo "${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so does not exist" >&2
+ echo "Failed: ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so does not exist" >&2
exit 1
fi
@@ -201,6 +205,8 @@
[ -d ${PLYMOUTH_CONFDIR} ] || mkdir -p ${PLYMOUTH_CONFDIR}
grep -q '^[[]Daemon[]]' ${PLYMOUTH_CONFDIR}/plymouthd.conf 2> /dev/null || echo '[Daemon]' >> ${PLYMOUTH_CONFDIR}/plymouthd.conf
+sed -i -e '/^\#\[Daemon\][[:blank:]]*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf
+sed -i -e '/^#Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf
sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf
sed -i -e "s/^\([[]Daemon[]]\)\n*/\1\nTheme=${THEME_NAME}/" ${PLYMOUTH_CONFDIR}/plymouthd.conf
diff -Nura plymouth-0.9.5~git20210406.e554475/scripts/plymouth-update-initrd plymouth-0.9.5~git20210406.e554475_new/scripts/plymouth-update-initrd
--- plymouth-0.9.5~git20210406.e554475/scripts/plymouth-update-initrd 2021-04-06 19:53:40.000000000 +0800
+++ plymouth-0.9.5~git20210406.e554475_new/scripts/plymouth-update-initrd 2021-09-07 21:51:02.107700743 +0800
@@ -1,2 +1,3 @@
#!/bin/bash
-dracut -f
+echo "Regenerating initrd ..."
+dracut -qf
diff -Nura plymouth-0.9.5~git20210406.e554475/src/main.c plymouth-0.9.5~git20210406.e554475_new/src/main.c
--- plymouth-0.9.5~git20210406.e554475/src/main.c 2021-04-06 19:53:40.000000000 +0800
+++ plymouth-0.9.5~git20210406.e554475_new/src/main.c 2021-09-07 21:21:36.752188499 +0800
@@ -462,20 +462,9 @@
}
if (state->boot_splash == NULL) {
- ply_trace ("Trying old scheme for default splash");
- state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "default.plymouth");
- }
-
- if (state->boot_splash == NULL) {
ply_trace ("Could not start default splash screen,"
- "showing text splash screen");
- state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "text/text.plymouth");
- }
-
- if (state->boot_splash == NULL) {
- ply_trace ("Could not start text splash screen,"
- "showing built-in splash screen");
- state->boot_splash = show_theme (state, NULL);
+ "showing details splash screen");
+ state->boot_splash = show_theme (state, PLYMOUTH_THEME_PATH "details/details.plymouth");
}
if (state->boot_splash == NULL) {