blob: 3fdcc3312d3e7b53bb98b6f052d4b033bad39541 [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"
# boot-splash depends on udev-trigger-early because frecon does need
# graphics device to be ready to display splash screen and tty (ptmx)
# device to create terminals, it also uses input devices (though they
# can also be hotplugged).
start on stopped udev-trigger-early
# If no assets are available to show, assume "embedded".
# If a specific embedded device needs different parameters, see:
# http://upstart.ubuntu.com/cookbook/#separating-variables-from-the-job
env ASSETLESS_ARGS="--enable-osc --enable-vts --pre-create-vts"
script
# 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
ASSETS=/usr/share/chromeos-assets
ASSETS_200=${ASSETS}/images_200_percent
ASSETS_100=${ASSETS}/images_100_percent
# Use differently-sized images depending on the framebuffer width.
if [ -e "${ASSETS_200}/boot_splash_frame01.png" ]; then
ARGS="--frame-interval 25"
BOOT_IMAGES=""
for image in "${ASSETS_200}"/boot_splash_frame*.png; do
BOOT_IMAGES="${BOOT_IMAGES} --image-hires ${image}"
done
for image in "${ASSETS_100}"/boot_splash_frame*.png; do
BOOT_IMAGES="${BOOT_IMAGES} --image ${image}"
done
elif [ -d "${ASSETS_100}" ]; then
ARGS="--frame-interval 25"
BOOT_IMAGES="${ASSETS_100}"/boot_splash_frame*.png
else
ARGS="${ASSETLESS_ARGS}"
fi
if is_developer_end_user; then
ARGS="${ARGS} --dev-mode --enable-osc --enable-vts --pre-create-vts"
fi
frecon --daemon --clear 0xfffefefe ${ARGS} ${BOOT_IMAGES}
end script