battery-updater : Add initial battery updater scripts
Adds the following files :
./scripts/chromeos-battery-update.sh
./scripts/chromeos-battery-update.conf
BUG=chrome-os-partner:24741
BRANCH=ToT
TEST=cros_workon-glimmer start battery_updater;emerge-glimmer battery_updater
Change-Id: I1d682b9f760cbe2d6b38e11b9b2630706861c2c9
Reviewed-on: https://chromium-review.googlesource.com/249935
Tested-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d6ec73d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..af7a7f5
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1 @@
+ssl@chromium.org
diff --git a/README b/README
new file mode 100644
index 0000000..241bd8f
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Chromium OS Battery Firmware Updater
diff --git a/scripts/chromeos-battery-update.conf b/scripts/chromeos-battery-update.conf
new file mode 100644
index 0000000..c86043b
--- /dev/null
+++ b/scripts/chromeos-battery-update.conf
@@ -0,0 +1,10 @@
+# Copyright 2015 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 "Battery firmware and config updater for Chromebooks"
+author "chromium-os-dev@chromium.org"
+
+# This job has no main script so that it only runs once at boot.
+task
+exec /opt/google/battery/scripts/chromeos-battery-update.sh
diff --git a/scripts/chromeos-battery-update.sh b/scripts/chromeos-battery-update.sh
new file mode 100644
index 0000000..c1d06e1
--- /dev/null
+++ b/scripts/chromeos-battery-update.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Copyright 2015 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.
+
+# PROTECT: 0 or 1
+# 0 means to keep un-protected (for firmware update test only);
+# 1 means to set battery interface to be protected
+# after finishing update battery firmware.
+PROTECT=1
+
+# DEBUG: 0 or 1 ; 0 means disable debug; 1 means enable debug;
+DEBUG=1
+ec_sb_firmware_update "${PROTECT}" "${DEBUG}"