Skip to content

Commit d34f5cb

Browse files
mwasilewroxell
authored andcommitted
automated: linux: allow disabling custom variable in ota-update
This patch allows to set empty u-boot custom variable name. This will prevent the test script from attempting to set the variable during the test. It is important for boards that use RPMB with only a list of allowed variables. Signed-off-by: Milosz Wasilewski <milosz.wasilewski@foundries.io>
1 parent 7dd49eb commit d34f5cb

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

automated/linux/ota-update/download-update.sh

+13-5
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ touch /var/sota/ota.signal
111111
touch /var/sota/ota.result
112112
report_pass "${TYPE}-create-signal-files"
113113

114-
if [ "${TYPE}" = "uboot" ]; then
114+
if [ "${TYPE}" = "uboot" ] && [ -n "${U_BOOT_VARIABLE_NAME}" ]; then
115115
"${UBOOT_VAR_SET_TOOL}" "${U_BOOT_VARIABLE_NAME}" "${U_BOOT_VARIABLE_VALUE}"
116116
fi
117117
#systemctl mask aktualizr-lite
@@ -148,8 +148,12 @@ compare_test_value "${TYPE}_rollback_before_download" "${ref_rollback_before_dow
148148
upgrade_available_before_download=$(uboot_variable_value upgrade_available)
149149
compare_test_value "${TYPE}_upgrade_available_before_download" "${ref_upgrade_available_before_download}" "${upgrade_available_before_download}"
150150
if [ "${TYPE}" = "uboot" ]; then
151-
uboot_variable_before_download=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
152-
compare_test_value "${TYPE}_uboot_variable_value_before_download" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_before_download}"
151+
if [ -n "${U_BOOT_VARIABLE_NAME}" ]; then
152+
uboot_variable_before_download=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
153+
compare_test_value "${TYPE}_uboot_variable_value_before_download" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_before_download}"
154+
else
155+
report_skip "${TYPE}_uboot_variable_value_before_download"
156+
fi
153157
fi
154158

155159
if [ -f /usr/lib/firmware/version.txt ]; then
@@ -210,8 +214,12 @@ else
210214
fi
211215

212216
if [ "${TYPE}" = "uboot" ]; then
213-
uboot_variable_after_download=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
214-
compare_test_value "${TYPE}_uboot_variable_value_after_download" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_download}"
217+
if [ -n "${U_BOOT_VARIABLE_NAME}" ]; then
218+
uboot_variable_after_download=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
219+
compare_test_value "${TYPE}_uboot_variable_value_after_download" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_download}"
220+
else
221+
report_skip "${TYPE}_uboot_variable_value_after_download"
222+
fi
215223
fi
216224

217225
UPGRADE_AVAILABLE="${upgrade_available_after_download}"

automated/linux/ota-update/verify-reboot.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ fiovb_is_secondary_boot_after_upgrade=$(uboot_variable_value "${SECONDARY_BOOT_V
8686
compare_test_value "fiovb_is_secondary_boot_after_upgrade" "${ref_fiovb_is_secondary_boot_after_upgrade}" "${fiovb_is_secondary_boot_after_upgrade}"
8787

8888
if [ "${TYPE}" = "uboot" ]; then
89-
uboot_variable_after_upgrade=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
90-
compare_test_value "${TYPE}_uboot_variable_value_after_upgrade" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_upgrade}"
89+
if [ -n "${U_BOOT_VARIABLE_NAME}" ]; then
90+
uboot_variable_after_upgrade=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
91+
compare_test_value "${TYPE}_uboot_variable_value_after_upgrade" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_upgrade}"
92+
else
93+
report_skip "${TYPE}_uboot_variable_value_after_upgrade"
94+
fi
9195
fi
9296
. /etc/os-release
9397
# shellcheck disable=SC2154

automated/linux/ota-update/verify-update.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ fiovb_is_secondary_boot_after_upgrade=$(uboot_variable_value "${SECONDARY_BOOT_V
116116
compare_test_value "fiovb_is_secondary_boot_after_upgrade" "${ref_fiovb_is_secondary_boot_after_upgrade}" "${fiovb_is_secondary_boot_after_upgrade}"
117117

118118
if [ "${TYPE}" = "uboot" ]; then
119-
uboot_variable_after_upgrade=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
120-
compare_test_value "${TYPE}_uboot_variable_value_after_upgrade" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_upgrade}"
119+
if [ -n "${U_BOOT_VARIABLE_NAME}" ]; then
120+
uboot_variable_after_upgrade=$(uboot_variable_value "${U_BOOT_VARIABLE_NAME}")
121+
compare_test_value "${TYPE}_uboot_variable_value_after_upgrade" "${U_BOOT_VARIABLE_VALUE}" "${uboot_variable_after_upgrade}"
122+
else
123+
report_skip "${TYPE}_uboot_variable_value_after_upgrade"
124+
fi
121125
fi
122126
. /etc/os-release
123127
# shellcheck disable=SC2154

0 commit comments

Comments
 (0)