blob: a49a28432eab94292d990667b284679c435bbd44 [file] [log] [blame]
#!/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.
TRIES="$(crossystem fwupdate_tries || echo 0)"
[ "${TRIES}" -gt 0 ] || exit 0
# FIRMWARE_UPDATE_LOGS will be collected by update-engine.
FIRMWARE_UPDATE_LOGS=/mnt/stateful_partition/update_firmware.log
FIRMWARE_UPDATE_SCRIPT=/usr/sbin/chromeos-firmwareupdate
# Decrease update counter
crossystem fwupdate_tries=$((TRIES - 1))
chromeos-boot-alert update_firmware
(date && "${FIRMWARE_UPDATE_SCRIPT}" --mode=startup 2>&1) |
tee -a ${FIRMWARE_UPDATE_LOGS}