Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:qzhao:bsc1195618_plash-screen-corrupts-when-installing-OS-onto-remote-iSCSI-disk_branches:SUSE:SLE-15-SP3:Update
plymouth
plymouth-set-default-theme-suse-branding.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File plymouth-set-default-theme-suse-branding.patch of Package plymouth
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-10-20 22:40:45.019107266 +0800 +++ plymouth-0.9.5~git20210406.e554475_new/scripts/plymouth-set-default-theme.in 2021-10-20 23:04:43.049484990 +0800 @@ -1,16 +1,19 @@ #!/bin/bash set -e +[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="/usr/libexec" +[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="/usr/share" +[ -z "$PLYMOUTH_CONFDIR" ] && PLYMOUTH_CONFDIR="/etc/plymouth/" +[ -z "$PLYMOUTH_POLICYDIR" ] && PLYMOUTH_POLICYDIR="/usr/share/plymouth/" +[ -z "$PLYMOUTH_CONFFILE"] && PLYMOUTH_CONFFILE="$PLYMOUTH_CONFDIR/plymouthd.conf" +[ -z "$PLYMOUTH_DEFFILE"] && PLYMOUTH_DEFFILE="/usr/share/plymouth/plymouthd.defaults" +[ -z "$OS" ] && OS=`cat /etc/os-release |grep ^NAME= |cut -d'=' -f2 |cut -d'"' -f2` -[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="@PLYMOUTH_LIBEXECDIR@" -[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@" -[ -z "$PLYMOUTH_CONFDIR" ] && PLYMOUTH_CONFDIR="@PLYMOUTH_CONF_DIR@" -[ -z "$PLYMOUTH_POLICYDIR" ] && PLYMOUTH_POLICYDIR="@PLYMOUTH_POLICY_DIR@" if [ -z "$PLYMOUTH_PLUGIN_PATH" ]; then if [ -z "$LIB" ]; then PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)" else - [ -z "$PLYMOUTH_LIBDIR" ] && PLYMOUTH_LIBDIR="@PLYMOUTH_LIBDIR@" + [ -z "$PLYMOUTH_LIBDIR" ] && PLYMOUTH_LIBDIR="/usr/lib64" PLYMOUTH_PLUGIN_PATH=${PLYMOUTH_LIBDIR}/plymouth/ fi fi @@ -56,27 +59,15 @@ ') } -function get_default_theme () +function get_current_theme () { - 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 - - 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" - fi - - echo $THEME_NAME + if [ -z "$THEME_NAME" -a -r "$PLYMOUTH_CONFFILE" ]; then + THEME_NAME=$(read_theme_name_from_file $PLYMOUTH_CONFFILE) + fi + + if [ -z "$THEME_NAME" -a -r "$PLYMOUTH_DEFFILE" ]; then + THEME_NAME=$(read_theme_name_from_file $PLYMOUTH_DEFFILE) + fi } DO_RESET=0 @@ -84,6 +75,7 @@ DO_LIST=0 DO_HELP=0 THEME_NAME="" + while [ $# -gt 0 ]; do case "$1" in @@ -163,46 +155,112 @@ fi if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $THEME_NAME ]; then - get_default_theme - exit $? + get_current_theme + if [[ ! -z $THEME_NAME ]];then + echo $THEME_NAME; + exit 0; + else + echo "No theme set." + exit 1; + fi fi if [ `id -u` -ne 0 ]; then echo "This program must be run as root" >&2 exit 1 -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 -fi +elif [ $DO_RESET -ne 0 ]; then + if [[ -z "$RELEASE_THEME_NAME" ]] && [[ "$OS" == "SLED" ]] || [[ "$OS" == "SLES" ]] ; then + RELEASE_THEME_NAME="SLE"; -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 - exit 1 -fi + elif [[ -z "$RELEASE_THEME_NAME" ]] && [[ "$OS" == *"openSUSE Tumbleweed"* ]] ; then + RELEASE_THEME_NAME="bgrt"; -MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//') + elif [[ -z "$RELEASE_THEME_NAME" ]] && [[ "$OS" == *"openSUSE Leap"* ]] ; then + RELEASE_THEME_NAME="opensuse"; + fi -if [ ! -e ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so ]; then - echo "${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so does not exist" >&2 - exit 1 -fi + Daemon_found=-1; + Theme_found=-1; + ShowDelay_found=-1; + DeviceTimeout_found=-1; + + if [[ -e $PLYMOUTH_CONFFILE ]]; then + mapfile array_config < $PLYMOUTH_CONFFILE && > plymouthd.conf + lines=${#array_config[@]}; + line=0; + re_daemon_head="^[[:blank:]]*\[Daemon\].*$" + re_daemon_end="^[[:blank:]]*\[.*\]" + + for ((line=0; line<lines; line++)) do + if [[ ${array_config[$line]} =~ $re_daemon_head ]]; then + in_daemon=1; + Daemon_found=$line; + elif [[ ${array_config[$line]} =~ $re_daemon_end ]]; then + in_daemon=-1; + elif [[ $in_daemon -gt 0 ]]; then + if [[ ${array_config[$line]} == *"Theme="* ]]; then + array_config[$line]="Theme=$RELEASE_THEME_NAME"; + Theme_found=$line; + fi + + if [[ ${array_config[$line]} == *"ShowDelay="* ]]; then + array_config[$line]="ShowDelay=0"; + ShowDelay_found=$line; + fi + + if [[ ${array_config[$line]} == *"DeviceTimeout="* ]]; then + array_config[$line]="DeviceTimeout=8"; + DeviceTimeout_found=$line; + fi + fi + done + else + if [[ ! -d $PLYMOUTH_CONFDIR ]]; then + mkdir $PLYMOUTH_CONFDIR + fi + touch $PLYMOUTH_CONFFILE + fi + + if [[ Daemon_found -eq -1 ]]; then + Daemon_found=${#array_config[@]}; + array_config+=("[Daemon]"); + fi -[ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ] && rm -f ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth + if [[ Theme_found -lt 0 ]]; then + Theme_found=Daemon_found+1; + array_config=( "${array_config[@]:0:$Daemon_found+1}" "Theme=$RELEASE_THEME_NAME" "${array_config[@]:$Daemon_found+1}" ) + fi + + if [[ ShowDelay_found -lt 0 ]]; then + ShowDelay_found=Theme_found+1; + array_config=( "${array_config[@]:0:$Theme_found+1}" "ShowDelay=0" "${array_config[@]:$Theme_found+1}" ) + fi -[ -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 + if [[ DeviceTimeout_found -lt 0 ]]; then + DeviceTimeout_found=ShowDelay_found+1; + array_config=( "${array_config[@]:0:$ShowDelay_found+1}" "DeviceTimeout=8" "${array_config[@]:$ShowDelay_found+1}" ) + fi + printf "%s\n" ${array_config[@]} > $PLYMOUTH_CONFFILE; + exit 0; -[ $DO_INITRD_REBUILD -ne 0 ] && (${PLYMOUTH_LIBEXECDIR}/plymouth/plymouth-update-initrd) -exit 0 +elif [ $DO_INITRD_REBUILD -ne 0 ]; then + if [[ -z "$THEME_NAME" ]] ; then + get_current_theme + fi + + if [ ! -e ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then + 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 "Failed: ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so does not exist" >&2 + exit 1 + fi + + [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ] && rm -f ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth + (${PLYMOUTH_LIBEXECDIR}/plymouth/plymouth-update-initrd) + exit 0 +fi 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-10-20 22:46:52.369417254 +0800 @@ -1,2 +1,3 @@ #!/bin/bash -dracut -f +echo -e "Regenerating initrd image ..." +dracut -qf && echo -e "\e[1;32m[ OK ]" 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-10-20 22:37:38.751870849 +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) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor