Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: Parse resolution after splash.conf #405

Merged
merged 2 commits into from
Jun 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions packages/sysutils/busybox/scripts/init
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
fi
}

debug_msg() {
echo "$1" >&$SILENT_OUT
}

debug_shell() {
echo "### Starting debugging shell... type exit to quit ###"

Expand Down Expand Up @@ -433,24 +437,38 @@
fi
fi

# load splash
if [ -f /splash/splash.conf ]; then
. /splash/splash.conf
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"
vres="$(fbset 2>/dev/null | awk '/geometry/ { print $3 }')"

if [ -f /flash/oemsplash.png -o -f /flash/oemsplash-1080.png ]; then
if [ -n "$vres" -a -f /flash/oemsplash-$vres.png ]; then
SPLASHIMAGE="/flash/oemsplash-$vres.png"
elif [ -f /flash/oemsplash-1080.png ]; then
SPLASHIMAGE="/flash/oemsplash-1080.png"
else
SPLASHIMAGE="/flash/oemsplash.png"
fi
else
SPLASHIMAGE="/splash/splash-1080.png"
if [ -n "$vres" -a -f /splash/splash-$vres.png ]; then
SPLASHIMAGE="/splash/splash-$vres.png"
else
SPLASHIMAGE="/splash/splash-1080.png"
fi
fi
fi

# load splash
if [ -f /flash/oemsplash.png ]; then
SPLASHIMAGE="/flash/oemsplash.png"
elif [ -f /splash/splash.conf ]; then
. /splash/splash.conf
if [ -n "$SPLASHIMAGE" -a -f "$SPLASHIMAGE" ]; then
ply-image $SPLASHIMAGE > /dev/null 2>&1
fi

ply-image $SPLASHIMAGE > /dev/null 2>&1
debug_msg "Framebuffer vertical res: $vres"
debug_msg "Framebuffer splash image: $SPLASHIMAGE"
fi
fi
}
Expand Down