diff options
author | Milosz Wasilewski <milosz.wasilewski@foundries.io> | 2023-01-30 13:37:34 +0000 |
---|---|---|
committer | Anders Roxell <anders.roxell@gmail.com> | 2023-02-09 18:42:51 +0100 |
commit | a7e08f2e9a4ecdc8498a62d031d787e25fcb82a1 (patch) | |
tree | 61064b3dc1cb7f94e28ea1783b60d2c13ebf5c1e | |
parent | 1881ef21838817027eacd5aa5b088d8a740f110d (diff) |
automated: fix OTA verification without secondary path2023.02.01
Some boards use boot ROM that doesn't allow to boot from secondary path.
In such cases the OTA update will overwrite the primary u-boot. When
this happens is_secondary u-boot variable is set to 0. This patch adds
support for this use case to ota-update test.
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@foundries.io>
-rwxr-xr-x | automated/linux/ota-update/verify-update.sh | 11 | ||||
-rw-r--r-- | automated/linux/ota-update/verify-update.yaml | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/automated/linux/ota-update/verify-update.sh b/automated/linux/ota-update/verify-update.sh index 1cbda77b..196a021c 100755 --- a/automated/linux/ota-update/verify-update.sh +++ b/automated/linux/ota-update/verify-update.sh @@ -13,6 +13,7 @@ UBOOT_VAR_TOOL=fw_printenv export UBOOT_VAR_TOOL UBOOT_VAR_SET_TOOL=fw_setenv export UBOOT_VAR_SET_TOOL +BOOTROM_USE_SECONDARY="true" usage() { echo "\ @@ -34,15 +35,20 @@ usage() { On the unsecured systems it will usually be fw_setenv. On secured systems it might be fiovb_setenv + -b <true|false> BootROM supports secondary boot path + Defaults to 'true'. When set to 'false' the test + 'fiovb_is_secondary_boot_after_rollback' will use + 0 as a reference value. " } -while getopts "t:u:s:v:h" opts; do +while getopts "t:u:s:v:b:h" opts; do case "$opts" in t) TYPE="${OPTARG}";; u) UBOOT_VAR_TOOL="${OPTARG}";; s) UBOOT_VAR_SET_TOOL="${OPTARG}";; v) REF_TARGET_VERSION="${OPTARG}";; + b) BOOTROM_USE_SECONDARY="${OPTARG}";; h|*) usage ; exit 1 ;; esac done @@ -73,6 +79,9 @@ if [ "${TYPE}" = "uboot" ]; then ref_bootupgrade_available_after_upgrade=1 # boots to secondary slot. Set to 0 on a subsequent reboot ref_fiovb_is_secondary_boot_after_upgrade=1 + if [ "${BOOTROM_USE_SECONDARY}" = "false" ] || [ "${BOOTROM_USE_SECONDARY}" = "False" ]; then + ref_fiovb_is_secondary_boot_after_upgrade=0 + fi # set to 0 forcibly. It stays this way on the 1st reboot ref_bootfirmware_version_after_upgrade=0 else diff --git a/automated/linux/ota-update/verify-update.yaml b/automated/linux/ota-update/verify-update.yaml index 58128c19..94ef3bc6 100644 --- a/automated/linux/ota-update/verify-update.yaml +++ b/automated/linux/ota-update/verify-update.yaml @@ -15,14 +15,16 @@ metadata: devices: - imx8mm - imx6ull + - stm32mp15-disco params: UBOOT_VAR_TOOL: "fw_printenv" UBOOT_VAR_SET_TOOL: "fw_setenv" TYPE: "kernel" TARGET_VERSION: "1" + BOOTROM_USE_SECONDARY: "true" run: steps: - cd ./automated/linux/ota-update - - ./verify-update.sh -t "${TYPE}" -u "${UBOOT_VAR_TOOL}" -s "${UBOOT_VAR_SET_TOOL}" -v "${TARGET_VERSION}" + - ./verify-update.sh -t "${TYPE}" -u "${UBOOT_VAR_TOOL}" -s "${UBOOT_VAR_SET_TOOL}" -v "${TARGET_VERSION}" -b "${BOOTROM_USE_SECONDARY}" - ../../utils/send-to-lava.sh ./output/result.txt |