diff --git a/buildroot-external/ota/rauc-hook b/buildroot-external/ota/rauc-hook index f49847a60..3cbf05cc4 100755 --- a/buildroot-external/ota/rauc-hook +++ b/buildroot-external/ota/rauc-hook @@ -2,7 +2,34 @@ ## # Hooks -env + +case "$1" in + install-check) + if [ "$RAUC_MF_COMPATIBLE" = "$RAUC_SYSTEM_COMPATIBLE" ]; then + exit 0 + fi + # Be compatible with upcomming releases using haos OS ID + # shellcheck disable=SC2039 + rauc_new_os_compatible=${RAUC_SYSTEM_COMPATIBLE/hassos-/haos-} + if [ "$RAUC_MF_COMPATIBLE" = "${rauc_new_os_compatible}" ]; then + exit 0 + fi + # intel-nuc: Be compatible with upcomming generic-x86-64 + # shellcheck disable=SC2039 + rauc_new_board_compatible=${rauc_new_os_compatible/intel-nuc/generic-x86-64} + if [ "$RAUC_MF_COMPATIBLE" = "${rauc_new_board_compatible}" ]; then + exit 0 + fi + echo "Compatible does not match!" 1>&2 + exit 10 + ;; + slot-install) + # Use install handlers below + ;; + *) + exit 1 + ;; +esac # Handle boot hocks if [ "${RAUC_SLOT_CLASS}" = "boot" ]; then diff --git a/buildroot-external/scripts/ota.sh b/buildroot-external/scripts/ota.sh index 21c7c587f..1959dd777 100755 --- a/buildroot-external/scripts/ota.sh +++ b/buildroot-external/scripts/ota.sh @@ -32,6 +32,7 @@ function create_ota_update() { echo "version=$(hassos_version)" echo "[hooks]" echo "filename=hook" + echo "hooks=install-check" echo "[image.boot]" echo "filename=boot.vfat" echo "hooks=install"