aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@foundries.io>2022-09-21 08:56:47 +0100
committerAnders Roxell <anders.roxell@gmail.com>2022-10-05 14:53:55 +0200
commit3127faacf273281103a817567e981e656b156264 (patch)
tree826a3248479e284aaf69838d05ed3eb725df17ed
parent4265798ecf5b2c57fc2dfb01e467a7d41198bc61 (diff)
automated: linux: add ostree only option to ota-update
This patch allows to test type=ostree when using aktualizr-lite for pulling OTA updates. Signed-off-by: Milosz Wasilewski <milosz.wasilewski@foundries.io>
-rwxr-xr-xautomated/linux/ota-update/download-update.sh16
-rw-r--r--automated/linux/ota-update/download-update.yaml3
-rw-r--r--automated/linux/ota-update/z-99-aklite-callback-ostree.toml6
3 files changed, 21 insertions, 4 deletions
diff --git a/automated/linux/ota-update/download-update.sh b/automated/linux/ota-update/download-update.sh
index 55f65772..6420f901 100755
--- a/automated/linux/ota-update/download-update.sh
+++ b/automated/linux/ota-update/download-update.sh
@@ -12,10 +12,11 @@ UBOOT_VAR_TOOL=fw_printenv
export UBOOT_VAR_TOOL
UBOOT_VAR_SET_TOOL=fw_setenv
export UBOOT_VAR_SET_TOOL
+PACMAN_TYPE="ostree+compose_apps"
usage() {
echo "\
- Usage: $0 [-t <kernel|uboot>] [-u <u-boot var read>] [-s <u-boot var set>]
+ Usage: $0 [-t <kernel|uboot>] [-u <u-boot var read>] [-s <u-boot var set>] [-o <ostree|ostree+compose_apps>]
-t <kernel|uboot>
This determines type of upgrade test performed:
@@ -31,14 +32,19 @@ usage() {
On the unsecured systems it will usually be
fw_setenv. On secured systems it might be
fiovb_setenv
+ -o ostree or ostree+compose_apps rollback
+ These change the 'type' variable in 'pacman' section
+ of the final .toml file used by aklite. Default is
+ ostree+compose_apps
"
}
-while getopts "t:u:s:h" opts; do
+while getopts "t:u:s:o:h" opts; do
case "$opts" in
t) TYPE="${OPTARG}";;
u) UBOOT_VAR_TOOL="${OPTARG}";;
s) UBOOT_VAR_SET_TOOL="${OPTARG}";;
+ o) PACMAN_TYPE="${OPTARG}";;
h|*) usage ; exit 1 ;;
esac
done
@@ -73,7 +79,11 @@ cp aklite-callback.sh /var/sota/
chmod 755 /var/sota/aklite-callback.sh
mkdir -p /etc/sota/conf.d
-cp z-99-aklite-callback.toml /etc/sota/conf.d/
+if [ "${PACMAN_TYPE}" = "ostree" ]; then
+ cp z-99-aklite-callback-ostree.toml /etc/sota/conf.d/
+else
+ cp z-99-aklite-callback.toml /etc/sota/conf.d/
+fi
report_pass "${TYPE}-create-aklite-callback"
# create signal files
touch /var/sota/ota.signal
diff --git a/automated/linux/ota-update/download-update.yaml b/automated/linux/ota-update/download-update.yaml
index 1a788529..06df98d3 100644
--- a/automated/linux/ota-update/download-update.yaml
+++ b/automated/linux/ota-update/download-update.yaml
@@ -21,8 +21,9 @@ params:
UBOOT_VAR_TOOL: "fw_printenv"
UBOOT_VAR_SET_TOOL: "fw_setenv"
TYPE: "kernel"
+ PACMAN_TYPE: "ostree+compose_apps"
run:
steps:
- cd ./automated/linux/ota-update
- - ./download-update.sh -t "${TYPE}" -u "${UBOOT_VAR_TOOL}" -s "${UBOOT_VAR_SET_TOOL}"
+ - ./download-update.sh -t "${TYPE}" -u "${UBOOT_VAR_TOOL}" -s "${UBOOT_VAR_SET_TOOL}" -o "${PACMAN_TYPE}"
- ../../utils/send-to-lava.sh ./output/result.txt
diff --git a/automated/linux/ota-update/z-99-aklite-callback-ostree.toml b/automated/linux/ota-update/z-99-aklite-callback-ostree.toml
new file mode 100644
index 00000000..b2c2bf4e
--- /dev/null
+++ b/automated/linux/ota-update/z-99-aklite-callback-ostree.toml
@@ -0,0 +1,6 @@
+[pacman]
+type = "ostree"
+callback_program = "/var/sota/aklite-callback.sh"
+[bootloader]
+reboot_command = "/bin/true"
+