Skip to content

Commit

Permalink
automated: linux: fix factory-reset test
Browse files Browse the repository at this point in the history
Auto-registration script changed and this patch is required to fix the
test. From now on it is possible to set device tag using a file
/etc/sota/tag. Auto-registration script will pick the tag from there and
populate it to aktualizr-lite settings.

Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew authored and roxell committed Jun 4, 2024
1 parent 4fc8e57 commit 3a72a6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions automated/linux/factory-reset/prepare-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export RESULT_FILE
TYPE="factory_reset"
ADDITIONAL_TYPE=""
LABEL=""
SOTA_CONFDIR="/etc/sota/conf.d"
SOTA_DIR="/etc/sota"
SOTA_CONFDIR="${SOTA_DIR}/conf.d"
HSM_MODULE=""

usage() {
Expand Down Expand Up @@ -60,8 +61,9 @@ mkdir -p "${SOTA_CONFDIR}"
cp z-99-aklite-callback.toml "${SOTA_CONFDIR}"
cp z-99-aklite-disable-reboot.toml "${SOTA_CONFDIR}"
if [ -n "${LABEL}" ]; then
echo "[pacman]" > "${SOTA_CONFDIR}"/z-99-aklite-tag.toml
echo "tags = ${LABEL}" >> "${SOTA_CONFDIR}"/z-99-aklite-tag.toml
# tag will be applied to aklite settings
# from auto-registration script
echo "${LABEL}" > "${SOTA_DIR}/tag"
fi
if [ -n "${HSM_MODULE}" ]; then
echo "HSM_MODULE=\"${HSM_MODULE}\"" > /etc/sota/hsm
Expand Down

0 comments on commit 3a72a6c

Please sign in to comment.