Merge pull request #381 from MilhouseVH/splash_native
splash: Select splash image based on native resolution
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
BIN
distributions/LibreELEC/splash/splash-1200.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
distributions/LibreELEC/splash/splash-2160.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
distributions/LibreELEC/splash/splash-720.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
distributions/LibreELEC/splash/splash-768.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
@ -144,6 +144,10 @@
|
|||||||
overlay)
|
overlay)
|
||||||
OVERLAY=yes
|
OVERLAY=yes
|
||||||
;;
|
;;
|
||||||
|
setfbres=*)
|
||||||
|
SWITCH_FRAMEBUFFER="${arg#*=}"
|
||||||
|
SWITCH_FRAMEBUFFER="${SWITCH_FRAMEBUFFER//,/ }"
|
||||||
|
;;
|
||||||
break=*)
|
break=*)
|
||||||
BREAK="${arg#*=}"
|
BREAK="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
@ -395,25 +399,50 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
load_splash() {
|
load_splash() {
|
||||||
|
local set_default_res=no
|
||||||
|
local vres
|
||||||
|
|
||||||
if [ ! "$SPLASH" = "no" ]; then
|
if [ ! "$SPLASH" = "no" ]; then
|
||||||
progress "Loading bootsplash"
|
progress "Loading bootsplash"
|
||||||
|
|
||||||
SPLASHIMAGE="/splash/splash-full.png"
|
|
||||||
|
|
||||||
# load uvesafb module if needed
|
# load uvesafb module if needed
|
||||||
if [ -f "$MODULE_DIR/uvesafb.ko" -a ! -e /dev/fb0 ]; then
|
if [ -f "$MODULE_DIR/uvesafb.ko" -a ! -e /dev/fb0 ]; then
|
||||||
progress "Loading kernel module uvesafb.ko"
|
progress "Loading kernel module uvesafb.ko"
|
||||||
insmod "$MODULE_DIR/uvesafb.ko" || \
|
insmod "$MODULE_DIR/uvesafb.ko" && \
|
||||||
|
set_default_res=yes || \
|
||||||
progress "... Failed to load kernel module uvesafb, skipping"
|
progress "... Failed to load kernel module uvesafb, skipping"
|
||||||
|
|
||||||
# set framebuffer to a default resolution (1024x768-32)
|
|
||||||
if [ ! "$SWITCH_FRAMEBUFFER" = "no" ]; then
|
|
||||||
fbset -g 1024 768 1024 768 32
|
|
||||||
SPLASHIMAGE="/splash/splash-1024.png"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e /dev/fb0 ]; then
|
if [ -e /dev/fb0 ]; then
|
||||||
|
# Set framebuffer to a custom resolution and/or fallback to default resolution (1024x768-32), if required.
|
||||||
|
if [ ! "$SWITCH_FRAMEBUFFER" = "no" ]; then
|
||||||
|
if [ "$SWITCH_FRAMEBUFFER" = "1080" ]; then
|
||||||
|
SWITCH_FRAMEBUFFER="1920 1080 1920 1080 32"
|
||||||
|
elif [ "$SWITCH_FRAMEBUFFER" = "720" ]; then
|
||||||
|
SWITCH_FRAMEBUFFER="1280 720 1280 720 32"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try setting a custom framebuffer resolution
|
||||||
|
if [ ! "${SWITCH_FRAMEBUFFER:-yes}" = "yes" ]; then
|
||||||
|
fbset -g $SWITCH_FRAMEBUFFER 2>/dev/null && set_default_res=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set a default resolution if required
|
||||||
|
if [ "$set_default_res" = "yes" ]; then
|
||||||
|
fbset -g 1024 768 1024 768 32
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Select splash image based on current native resolution
|
||||||
|
if [ -z "$SPLASHIMAGE" ]; then
|
||||||
|
vres="$(fbset | awk '/geometry/ { print $3 }')"
|
||||||
|
if [ -n "$vres" -a -f /splash/splash-$vres.png ]; then
|
||||||
|
SPLASHIMAGE="/splash/splash-$vres.png"
|
||||||
|
else
|
||||||
|
SPLASHIMAGE="/splash/splash-1080.png"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# load splash
|
# load splash
|
||||||
if [ -f /flash/oemsplash.png ]; then
|
if [ -f /flash/oemsplash.png ]; then
|
||||||
SPLASHIMAGE="/flash/oemsplash.png"
|
SPLASHIMAGE="/flash/oemsplash.png"
|
||||||
|
@ -50,14 +50,12 @@ makeinstall_init() {
|
|||||||
if [ -f $PROJECT_DIR/$PROJECT/splash/splash.conf ]; then
|
if [ -f $PROJECT_DIR/$PROJECT/splash/splash.conf ]; then
|
||||||
cp $PROJECT_DIR/$PROJECT/splash/splash.conf $INSTALL/splash
|
cp $PROJECT_DIR/$PROJECT/splash/splash.conf $INSTALL/splash
|
||||||
cp $PROJECT_DIR/$PROJECT/splash/*.png $INSTALL/splash
|
cp $PROJECT_DIR/$PROJECT/splash/*.png $INSTALL/splash
|
||||||
elif [ -f $PROJECT_DIR/$PROJECT/splash/splash-1024.png \
|
elif ls $PROJECT_DIR/$PROJECT/splash/splash-*.png 1>/dev/null 2>&1; then
|
||||||
-o -f $PROJECT_DIR/$PROJECT/splash/splash-full.png ]; then
|
|
||||||
cp $PROJECT_DIR/$PROJECT/splash/splash-*.png $INSTALL/splash
|
cp $PROJECT_DIR/$PROJECT/splash/splash-*.png $INSTALL/splash
|
||||||
elif [ -f $DISTRO_DIR/$DISTRO/splash/splash.conf ]; then
|
elif [ -f $DISTRO_DIR/$DISTRO/splash/splash.conf ]; then
|
||||||
cp $DISTRO_DIR/$DISTRO/splash/splash.conf $INSTALL/splash
|
cp $DISTRO_DIR/$DISTRO/splash/splash.conf $INSTALL/splash
|
||||||
cp $DISTRO_DIR/$DISTRO/splash/*.png $INSTALL/splash
|
cp $DISTRO_DIR/$DISTRO/splash/*.png $INSTALL/splash
|
||||||
elif [ -f $DISTRO_DIR/$DISTRO/splash/splash-1024.png \
|
elif ls $DISTRO_DIR/$DISTRO/splash/splash-*.png 1>/dev/null 2>&1; then
|
||||||
-o -f $DISTRO_DIR/$DISTRO/splash/splash-full.png ]; then
|
|
||||||
cp $DISTRO_DIR/$DISTRO/splash/splash-*.png $INSTALL/splash
|
cp $DISTRO_DIR/$DISTRO/splash/splash-*.png $INSTALL/splash
|
||||||
else
|
else
|
||||||
cp $PKG_DIR/splash/splash-*.png $INSTALL/splash
|
cp $PKG_DIR/splash/splash-*.png $INSTALL/splash
|
||||||
|