diff -Nura plymouth-0.9.5+git20190908+3abfab2/scripts/plymouth-populate-initrd.in plymouth-0.9.5+git20190908+3abfab2_new/scripts/plymouth-populate-initrd.in --- plymouth-0.9.5+git20190908+3abfab2/scripts/plymouth-populate-initrd.in 2020-08-29 16:43:14.303181545 +0800 +++ plymouth-0.9.5+git20190908+3abfab2_new/scripts/plymouth-populate-initrd.in 2020-08-29 23:07:23.332595874 +0800 @@ -396,6 +396,8 @@ inst @RELEASE_FILE@ $INITRDDIR inst ${PLYMOUTH_POLICYDIR}/plymouthd.defaults $INITRDDIR inst ${PLYMOUTH_CONFDIR}/plymouthd.conf $INITRDDIR +inst ${PLYMOUTH_DATADIR}/plymouth/plymouthd.conf $INITRDDIR + if [ -z "$PLYMOUTH_THEME_NAME" ]; then echo "No default plymouth plugin is set" >&2 @@ -403,8 +405,12 @@ fi if [ $THEME_OVERRIDE ]; then - conf=$INITRDDIR/${PLYMOUTH_CONFDIR}/plymouthd.conf - echo "modifying plymouthd.conf: Theme=$PLYMOUTH_THEME_NAME" >&2 + if [ -f /etc/plymouth/plymouthd.conf ]; then + conf=$INITRDDIR/${PLYMOUTH_CONFDIR}/plymouthd.conf + elif [ -f /usr/share/plymouth/plymouthd.defaults ]; then + conf=$INITRDDIR/${PLYMOUTH_DATADIR}/plymouth/plymouthd.conf + fi + echo "modifying plymouthd config file: Theme=$PLYMOUTH_THEME_NAME" >&2 # make sure the section and key exist so we can modify them grep -q "^ *\[Daemon\]" $conf || echo "[Daemon]" >> $conf grep -q "^ *Theme *=" $conf || echo "Theme=fade-in" >> $conf diff -Nura plymouth-0.9.5+git20190908+3abfab2/scripts/plymouth-set-default-theme.in plymouth-0.9.5+git20190908+3abfab2_new/scripts/plymouth-set-default-theme.in --- plymouth-0.9.5+git20190908+3abfab2/scripts/plymouth-set-default-theme.in 2019-09-09 15:31:37.000000000 +0800 +++ plymouth-0.9.5+git20190908+3abfab2_new/scripts/plymouth-set-default-theme.in 2020-08-30 12:47:49.602316219 +0800 @@ -58,7 +58,12 @@ function get_default_theme () { - THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_CONFDIR}/plymouthd.conf) + if [ -f /etc/plymouth/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 THEME_NAME=$(read_theme_name_from_file ${PLYMOUTH_POLICYDIR}/plymouthd.defaults) fi @@ -168,9 +173,15 @@ fi if [ $DO_RESET -ne 0 ]; then - [ -f ${PLYMOUTH_CONFDIR}/plymouthd.conf ] || exit 0 - sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf - exit $? + 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 + sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defauts + exit $? + else + exit 0 + fi fi if [ ! -e ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then @@ -187,10 +198,10 @@ [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ] && rm -f ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth -[ -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 '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_CONFDIR}/plymouthd.conf -sed -i -e "s/^\([[]Daemon[]]\)\n*/\1\nTheme=${THEME_NAME}/" ${PLYMOUTH_CONFDIR}/plymouthd.conf +[ -d ${PLYMOUTH_DATADIR} ] || mkdir -p ${PLYMOUTH_DATADIR} +grep -q '^[[]Daemon[]]' ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defaults 2> /dev/null || echo '[Daemon]' >> ${PLYMOUTH_DATADIR}/plymouthd.defaults +sed -i -e '/^Theme[[:blank:]]*=.*/d' ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defaults +sed -i -e "s/^\([[]Daemon[]]\)\n*/\1\nTheme=${THEME_NAME}/" ${PLYMOUTH_DATADIR}/plymouth/plymouthd.defaults [ $DO_INITRD_REBUILD -ne 0 ] && (${PLYMOUTH_LIBEXECDIR}/plymouth/plymouth-update-initrd) exit 0 diff -Nura plymouth-0.9.5+git20190908+3abfab2/src/main.c plymouth-0.9.5+git20190908+3abfab2_new/src/main.c --- plymouth-0.9.5+git20190908+3abfab2/src/main.c 2020-08-29 16:43:22.589272043 +0800 +++ plymouth-0.9.5+git20190908+3abfab2_new/src/main.c 2020-08-29 16:47:35.607035410 +0800 @@ -424,8 +424,8 @@ if (state->distribution_default_splash_path != NULL) return; - if (!load_settings (state, PLYMOUTH_RUNTIME_DIR "/plymouthd.defaults", &state->distribution_default_splash_path)) { - ply_trace ("failed to load " PLYMOUTH_RUNTIME_DIR "/plymouthd.defaults, trying " PLYMOUTH_POLICY_DIR); + if (!load_settings (state, PLYMOUTH_DATADIR "/plymouthd.defaults", &state->distribution_default_splash_path)) { + ply_trace ("failed to load " PLYMOUTH_DATADIR "/plymouthd.defaults, trying " PLYMOUTH_DATADIR); if (!load_settings (state, PLYMOUTH_POLICY_DIR "plymouthd.defaults", &state->distribution_default_splash_path)) { ply_trace ("failed to load " PLYMOUTH_POLICY_DIR "plymouthd.defaults"); return; @@ -447,16 +447,21 @@ state->boot_splash = show_theme (state, state->override_splash_path); } - if (state->boot_splash == NULL && - state->system_default_splash_path != NULL) { - ply_trace ("Trying system default splash"); - state->boot_splash = show_theme (state, state->system_default_splash_path); - } - - if (state->boot_splash == NULL && - state->distribution_default_splash_path != NULL) { - ply_trace ("Trying distribution default splash"); - state->boot_splash = show_theme (state, state->distribution_default_splash_path); + if (access("/etc/plymouth/plymouthd.conf", F_OK ) != -1) + { + if ( state->boot_splash == NULL && + state->system_default_splash_path != NULL) { + ply_trace ("Trying system default splash"); + state->boot_splash = show_theme (state, state->system_default_splash_path); + } + } + else if (access("/usr/share/plymouth/plymouthd.defaults", F_OK ) != -1) + { + if (state->boot_splash == NULL && + state->distribution_default_splash_path != NULL) { + ply_trace ("Trying distribution default splash"); + state->boot_splash = show_theme (state, state->distribution_default_splash_path); + } } if (state->boot_splash == NULL) { @@ -2254,9 +2259,13 @@ return EX_UNAVAILABLE; } + find_override_splash (&state); - find_system_default_splash (&state); - find_distribution_default_splash (&state); + + if( access("/etc/plymouth/plymouthd.conf", F_OK ) != -1 ) + find_system_default_splash (&state); + else if( access("/usr/share/plymouth/plymouthd.defaults", F_OK ) != -1 ) + find_distribution_default_splash (&state); if (ply_kernel_command_line_has_argument ("plymouth.ignore-serial-consoles")) device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_SERIAL_CONSOLES; diff -Nura plymouth-0.9.5+git20190908+3abfab2/src/Makefile.am plymouth-0.9.5+git20190908+3abfab2_new/src/Makefile.am --- plymouth-0.9.5+git20190908+3abfab2/src/Makefile.am 2019-09-09 15:31:37.000000000 +0800 +++ plymouth-0.9.5+git20190908+3abfab2_new/src/Makefile.am 2020-08-29 16:48:03.959297800 +0800 @@ -16,6 +16,7 @@ plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS) \ -rdynamic \ + -DPLYMOUTH_DATADIR=\"$(PLYMOUTH_DATAPATH)\" \ -DPLYMOUTH_PLUGIN_PATH=\"$(PLYMOUTH_PLUGIN_PATH)\" \ -DPLYMOUTH_THEME_PATH=\"$(PLYMOUTH_THEME_PATH)/\" \ -DPLYMOUTH_POLICY_DIR=\"$(PLYMOUTH_POLICY_DIR)/\" \