blob: af0303cd5a6e80579d2cc022979a9b0a4d01e12a [file] [log] [blame]
# Copyright (c) 2013 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 "Chrome OS factory startup stub"
author "chromium-os-dev@chromium.org"
start on started system-services
stop on stopping system-services
pre-start script
. /usr/share/cros/factory_utils.sh
if ! is_factory_mode; then
stop
fi
# Preventing tty2 (developer shell console) to go blank after some idle time
for i in $(seq 2 4); do
setterm -cursor on -blank 0 -powersave off -powerdown 0 >/dev/tty${i} || true
done
end script
script
FACTORY_BASE=/usr/local/factory
TTY_VT=4
TTY="/dev/tty$TTY_VT"
(tput clear; echo -n "--- Starting Factory --- "; date) >$TTY
chvt $TTY_VT
# Sleep briefly for chvt to take effect and for the displayed
# messages to be seen
sleep .3
"$FACTORY_BASE/bin/goofy_control" start >$TTY || true
# This should never happen, since goofy never returns. Kill X
# and display an error on $TTY
(
echo -n "--- Factory Aborted --- "
date
"$FACTORY_BASE/bin/goofy_control" stop
) >$TTY
chvt $TTY_VT
end script
pre-stop script
# Stops UI before we kill X
stop ui
pkill python
pkill X
end script