Commit 1409092c authored by Harry Pan's avatar Harry Pan Committed by chrome-internal-fetch
Browse files

Add lulu overlay

BUG=chrome-os-partner:34368
TEST=./setup_board --board=lulu && ./build_packages --board=lulu

Change-Id: I9653a1feb493245e532ea67df00f77e8b71cfc27
Reviewed-on: https://chromium-review.googlesource.com/233750

Reviewed-by: default avatarBernie Thompson <bhthompson@chromium.org>
Commit-Queue: Harry Pan <harry.pan@intel.com>
Tested-by: default avatarHarry Pan <harry.pan@intel.com>
parent 0fd0313a
chromeos-bsp-lulu-0.0.1.ebuild
\ No newline at end of file
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=4
inherit appid
DESCRIPTION="Ebuild which pulls in any necessary ebuilds as dependencies
or portage actions."
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE=""
S="${WORKDIR}"
# Add dependencies on other ebuilds from within this board overlay
RDEPEND="
chromeos-base/chromeos-bsp-baseboard-auron
chromeos-base/ec-utils
sys-kernel/linux-firmware
media-gfx/ply-image
"
DEPEND="${RDEPEND}"
src_install() {
doappid "{40C6BCAB-B8D4-466F-9C3C-069B8CAC36D7}"
# Install platform specific config files for power_manager.
insinto "/usr/share/power_manager/board_specific"
doins "${FILESDIR}/low_battery_shutdown_percent"
# Battery cut-off
dosbin "${FILESDIR}/battery_cut_off.sh"
dosbin "${FILESDIR}/board_factory_wipe.sh"
dosbin "${FILESDIR}/board_factory_reset.sh"
dosbin "${FILESDIR}/board_charge_battery.sh"
insinto "/usr/share/factory/images"
doins "${FILESDIR}/remove_ac.png"
doins "${FILESDIR}/cutting_off.png"
doins "${FILESDIR}/cutoff_failed.png"
doins "${FILESDIR}/charging.png"
doins "${FILESDIR}/connect_ac.png"
}
#!/bin/bash
#
# Copyright 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.
#
# This script uses ectool to send command to EC to cut off the battery power.
#
IMG_PATH="/usr/share/factory/images"
TTY="/dev/tty1"
modprobe i2c_dev
if (ectool battery | grep -q AC_PRESENT); then
if [ -e "${IMG_PATH}/remove_ac.png" ]; then
ply-image --clear 0x000000 "${IMG_PATH}/remove_ac.png"
else
echo "============================================" >"$TTY"
echo "========== Unplug AC adapter now. ==========" >"$TTY"
echo "============================================" >"$TTY"
echo "" >"$TTY"
fi
while (ectool battery | grep -q AC_PRESENT) ; do
sleep 0.5;
done
fi
if [ -e "${IMG_PATH}/cutting_off.png" ]; then
ply-image --clear 0x000000 "${IMG_PATH}/cutting_off.png"
else
echo "===============================================" >"$TTY"
echo "==== Cutting off battery. Wait 10 seconds. ====" >"$TTY"
echo "===============================================" >"$TTY"
fi
ectool batterycutoff
sleep 15
# Couldn't have reached here
if [ -e "${IMG_PATH}/cutoff_failed.png" ]; then
ply-image --clear 0x000000 "${IMG_PATH}/cutoff_failed.png"
else
echo "======================================" >"$TTY"
echo "========== Cut off failed!! ==========" >"$TTY"
echo "======================================" >"$TTY"
echo "" >"$TTY"
fi
sleep 1d
exit 1
#!/bin/bash
#
# Copyright 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.
#
# This script checks the battery level is high enough for shipping. If not,
# it asks for AC power and waits for the battery to charge.
#
IMG_PATH="/usr/share/factory/images"
MIN_LEVEL=40
TTY="/dev/tty1"
get_percentage() {
power_supply_info 2>/dev/null \
| awk '/percentage/ && !/display/ {print int($2)}'
}
mkdir -p /var/lib/power_manager
if [[ $(get_percentage) -le $MIN_LEVEL ]]; then
# Ask for AC power
if [ -z "$(ectool battery | grep -q AC_PRESENT)" ]; then
ply-image --clear 0x000000 "${IMG_PATH}/connect_ac.png"
while [ -z "$(ectool battery | grep -q AC_PRESENT)" ]; do
sleep 0.5;
done
fi
# Wait for battery to charge to MIN_LEVEL
ply-image --clear 0x000000 "${IMG_PATH}/charging.png"
while [[ $(get_percentage) -le $MIN_LEVEL ]]; do
printf "\033[0;0H\033[K" >"$TTY"
echo -n "Current Battery Level: $(get_percentage)%" >"$TTY"
sleep 1
done
fi
#!/bin/sh -e
#
# Copyright 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.
#
/usr/sbin/activate_date --clean
# remove the cached vpd log file so that the next reboot will re-generate it
# in /etc/init/vpd-log.conf.
VPD_2_0="/var/log/vpd_2.0.txt"
rm -f $VPD_2_0
sync
sleep 3
/usr/sbin/board_charge_battery.sh
/usr/sbin/battery_cut_off.sh
# Battery cut-off is failed if it returns with 1.
if [ $? -eq 1 ]; then
echo "Battery cut-off is failed."
fi
exit 1
#!/bin/sh -e
#
# Copyright 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.
#
/usr/sbin/activate_date --clean
# make sure the cached vpd log file has been removed so that the the next reboot
# will re-generate it in /etc/init/vpd-log.conf.
VPD_2_0="/var/log/vpd_2.0.txt"
rm -f $VPD_2_0
sync
sleep 3
# this script is called by clobber-state
/usr/sbin/battery_cut_off.sh
# Battery cut-off is failed if it returns with 1.
if [ $? -eq 1 ]; then
echo "Battery cut-off is failed."
fi
exit 1
# reboot after return to clobber-state(default)
- image: cutoff_failed.png
text: Battery cut-off failed\nContact factory team\n无法切断电池电源\n请联络RD
fg_color: '#ff0000'
font_size: 60
- image: cutting_off.png
text: Cutting off battery.\nPlease wait...\n切断电池电源中\n请稍候...
fg_color: '#ffffff'
font_size: 60
- image: remove_ac.png
text: Please remove AC power\nfor battery cut-off\n请移除AC电源
fg_color: '#ffff00'
font_size: 60
- image: connect_ac.png
text: Battery level too low.\nPlease connect AC power.\n电池电量过低\n请连接AC电源
fg_color: '#ffff00'
font_size: 60
- image: charging.png
text: Charging battery to 40%...\n正在充电...(目标40%)
fg_color: '#ffffff'
font_size: 60
# Copyright 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.
USE="${USE} als"
# Uncomment this line to activate the serial port.
#TTY_CONSOLE="${TTY_CONSOLE} ttyS0"
masters = portage-stable chromiumos baseboard-auron freon
profile-formats = portage-2
repo-name = lulu
thin-manifests = true
use-manifests = true
chromiumos:default/linux/amd64/10.0/chromeos
baseboard-auron:base
freon:base/amd64
x86_64-cros-linux-gnu
# This is needed to build the target firmware
i686-pc-linux-gnu
# This is needed to build the EC firmware
arm-none-eabi
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=4
DESCRIPTION="Chrome OS BSP virtual package"
HOMEPAGE="http://src.chromium.org"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="-* amd64 x86"
RDEPEND="chromeos-base/chromeos-bsp-lulu"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment