| #!/bin/sh |
| # Copyright (c) 2014 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. |
| |
| MYDIR="$(dirname "$(readlink -f "$0")")" |
| FACTORY_BASE="/usr/local/factory" |
| |
| is_freon() { |
| # Currently we only install frecon on freon boards. |
| if [ -x "/sbin/frecon" ]; then |
| return 0 |
| else |
| return 1 |
| fi |
| } |
| |
| run_chrome_in_tmp() { |
| # For factory environment, we don't need to preserve Chrome session data. |
| mount -t tmpfs none /home/chronos |
| } |
| |
| main() { |
| # For freon boards: We disable powerd in factory test mode, but the screen |
| # backlight is turned on by powerd. Manually set the brightness level to |
| # 50% of max brightness. |
| if is_freon; then |
| backlight_tool --set_brightness_percent=50.0 |
| fi |
| |
| # Install console (VT2) customizations |
| mount --bind "${MYDIR}/profile.d/vt2.sh" /etc/profile.d/cursor.sh |
| |
| if [ -f "${FACTORY_BASE}/py/goofy/GOOFY_SPLIT" ]; then |
| # Load presenter app if we are running goofy_presenter. |
| if [ -f "${MYDIR}/run_goofy_presenter" ]; then |
| mount --bind "${MYDIR}/etc/presenter.conf" /etc/chrome_dev.conf |
| run_chrome_in_tmp |
| fi |
| # Leave UI as is for goofy_device for now. |
| else |
| # Install UI configurations |
| mount --bind "${MYDIR}/etc/chrome_dev.conf" /etc/chrome_dev.conf |
| run_chrome_in_tmp |
| fi |
| } |
| |
| main "$@" |