blob: bc5d9c119f273d4a6732d47dad2f51e152145800 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "Displays an animation while the system is booting"
author "chromium-os-dev@chromium.org"
start on startup
task
script
if [ ! -f /root/.factory_installer ]; then
# Set the backlight to 40% of its maximum level.
BACKLIGHT_DIR=/sys/class/backlight
if [ -d $BACKLIGHT_DIR ] &&
[ -n "$(find $BACKLIGHT_DIR -maxdepth 0 ! -empty)" ]; then
backlight_tool --set_brightness_percent=40.0 || true
fi
# Use differently-sized images depending on the framebuffer width.
if [ -x /sbin/frecon ]; then
RESOLUTION_CMD=frecon
else
RESOLUTION_CMD=ply-image
fi
WIDTH=$($RESOLUTION_CMD --print-resolution | cut -d ' ' -f 1)
ASSETS=/usr/share/chromeos-assets
ASSETS_200=$ASSETS/images_200_percent
ASSETS_100=$ASSETS/images_100_percent
if [ $WIDTH -gt 1920 -a -e "$ASSETS_200/boot_splash_frame01.png" ]; then
BOOT_IMAGES="$ASSETS_200"/boot_splash_frame*.png
else
BOOT_IMAGES="$ASSETS_100"/boot_splash_frame*.png
fi
DEV_END_USER=
if is_developer_end_user; then
DEV_END_USER=--dev-mode
fi
show_splash() {
if [ -x /sbin/frecon ]; then
frecon --daemon \
--gamma /usr/share/color/bin/internal_display.bin \
--clear 0xfefefe $DEV_END_USER --frame-interval 25 \
$BOOT_IMAGES
else
# Disable blinking cursor. Without this, a splash screen will show a
# distinct cursor shape even when the cursor is set to none.
echo 0 > /sys/devices/virtual/graphics/fbcon/cursor_blink
ply-image --set-monitors \
--gamma /usr/share/color/bin/internal_display.bin \
--clear 0xfefefe --frame-interval 25 $BOOT_IMAGES
fi
}
if ! show_splash; then
# Triggering events is only useful if the udev daemon is up and
# responding, which we wait for here.
until udevadm control --reload; do
sleep 0.01s
done
udevadm trigger --action=add --subsystem-match="graphics" \
--subsystem-match="pci"
udevadm settle
show_splash
fi
fi
end script