• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# Copyright 2019 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7set -e
8
9. $(dirname "$(readlink -f "${0}")")/common.sh
10
11echo "Running test to verify that RW cannot update RO"
12
13readonly fw_file="${1}"
14
15check_file_exists "${fw_file}"
16
17echo "Making sure all write protect is enabled"
18enable_sw_write_protect
19check_hw_and_sw_write_protect_enabled
20
21echo "Validating initial state"
22check_has_mp_rw_firmware
23check_has_mp_ro_firmware
24check_running_rw_firmware
25check_is_rollback_set_to_initial_val
26
27echo "Flashing RO firmware (expected to fail)"
28flash_ro_cmd="flashrom --fast-verify -V -p ec:type=fp -i EC_RO -w ${fw_file}"
29if ${flash_ro_cmd}; then
30  echo "Expected flashing of read-only firmware to fail"
31  exit 1
32fi
33