labstation: Apply cambrionix firmware
Add an init script to run the upgrade - noop if no update needed.
BUG=b:278585904
TEST=local build of labstation - verified logs on boot
Cq-Depend: chromium:5834665
Change-Id: I0c3024e72974adfa1b213f662445bf27367dd591
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/labstation/+/5835055
Tested-by: Keith Haddow <haddowk@chromium.org>
Commit-Queue: Garry Wang <xianuowang@chromium.org>
Reviewed-by: Garry Wang <xianuowang@chromium.org>
Commit-Queue: Keith Haddow <haddowk@chromium.org>
Auto-Submit: Keith Haddow <haddowk@chromium.org>
diff --git a/os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf b/os-dependent/chromeos/upstart-scripts/find-cambrionix-mapping.conf
similarity index 72%
rename from os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf
rename to os-dependent/chromeos/upstart-scripts/find-cambrionix-mapping.conf
index e93dc18..f2912ff 100644
--- a/os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf
+++ b/os-dependent/chromeos/upstart-scripts/find-cambrionix-mapping.conf
@@ -5,10 +5,16 @@
description "Generate the mapping of servo serial to cambrionix usb port"
author "chromium-os-dev@chromium.org"
-start on started system-services
+start on stopped upgrade-cambrionix
# It is exceedingly unlikely to OOM, as it's a simple dbus-send call,
# but better to kill it than to panic the system.
oom score -100
-exec /usr/bin/find-cambrionix-mapping
\ No newline at end of file
+script
+ exec >>/usr/local/tmp/${UPSTART_JOB}.log 2>&1
+ set -x
+ set +e
+
+ /usr/bin/find-cambrionix-mapping
+end script
diff --git a/os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf b/os-dependent/chromeos/upstart-scripts/upgrade-cambrionix.conf
similarity index 62%
copy from os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf
copy to os-dependent/chromeos/upstart-scripts/upgrade-cambrionix.conf
index e93dc18..8a69aa8 100644
--- a/os-dependent/chromeos/upstart-scripts/find-cambronix-mapping.conf
+++ b/os-dependent/chromeos/upstart-scripts/upgrade-cambrionix.conf
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-description "Generate the mapping of servo serial to cambrionix usb port"
+description "Run the Cambrionix firmware updater."
author "chromium-os-dev@chromium.org"
start on started system-services
@@ -11,4 +11,11 @@
# but better to kill it than to panic the system.
oom score -100
-exec /usr/bin/find-cambrionix-mapping
\ No newline at end of file
+
+script
+ exec >>/usr/local/tmp/${UPSTART_JOB}.log 2>&1
+ set -x
+ set +e
+
+ /usr/local/bin/command-line-updater --path /usr/share/cambrionix/ --auto
+end script