blob: 3dadbecd31f6d100f3fbcc9e61c6f84a598673b5 [file] [log] [blame]
# Copyright (c) 2013 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 "Check if root disk firmware needs updating"
author "chromium-os-dev@chromium.org"
# Once partitions are initialized, check if the disk firmware needs updating.
# To prevent reading the firmware rule, looking at the disk, a file is saved
# at the end of a successful check/update. Look at this file first.
start on stopping startup
task
script
# Check if we have to run.
STATUS_FILE="/mnt/stateful_partition/unencrypted/cache/.disk_firmware_upgrade_completed"
RULE_FILE="/opt/google/disk/firmware/rules"
# If a previous upgrade worked fine skip this code.
if [ -s "${STATUS_FILE}" ]; then
exit 0
fi
# Log can be found in /var/log/messages.
chromeos-disk-firmware-update.sh \
--status "${STATUS_FILE}" \
--fw_package_dir "${RULE_FILE%/*}" || :
end script