Skip to content

Commit

Permalink
checkupdates.sh: add feed and status-file arguments
Browse files Browse the repository at this point in the history
This adds arguments to check a specific feed (-feed [release,..] etc)
instead of the Venus OS setting and allow to write the result to a
different file given by -status-file.

JHO: drop hardcoded assumptions about the release feed and move that
to venus-platform instead. Pass the feed as string instead of index
number.
  • Loading branch information
ReinvdZee authored and jhofstee committed Feb 3, 2025
1 parent c395ae7 commit 4a6cef0
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions meta-venus/recipes-support/swupdate-scripts/files/check-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ start_log

echo "*** Checking for updates ***"
echo "arguments: $@"
feed=""

while [[ $# -gt 0 ]]; do
case "$1" in
Expand All @@ -85,7 +86,15 @@ while [[ $# -gt 0 ]]; do
-check) update=2 ;;
-update) update=1 ;;
-delay) delay=y ;;
-feed)
shift
feed="$1"
;;
-force) force=y ;;
-status-file)
shift
status_file="$1"
;;
-swu)
shift
force=y
Expand Down Expand Up @@ -117,8 +126,10 @@ if [ "$help" = y ]; then
echo " use this when calling from cron or after boot."
echo "-check (only) check if there is a new version available."
echo "-update check and, when necessary, update."
echo "-feed set the feed to check. venus OS setting will be used if omitted."
echo "-force force downloading and installing the new image, even if its"
echo " version is older or same as already installed version."
echo "-status-file use given file for status updates instead of /var/run/swupdate-status"
echo "-swu url forcefully install the swu from given url"
echo "-swubase url use given url as a base, rather than the default:"
echo " https://updates.victronenergy.com/feeds/venus/[feed]/"
Expand Down Expand Up @@ -194,17 +205,19 @@ elif [ "$offline" = y ]; then
exit 1
fi
else
feed=$(get_setting ReleaseType)

case $feed in
0) feed=release ;;
1) feed=candidate ;;
2) feed=testing ;;
3) feed=develop ;;
*) echo "Invalid release type, exit."
exit 1
;;
esac
if [ -z "$feed" ]; then
feed=$(get_setting ReleaseType)

case $feed in
0) feed=release ;;
1) feed=candidate ;;
2) feed=testing ;;
3) feed=develop ;;
*) echo "Invalid release type, exit."
exit 1
;;
esac
fi

imgtype=$(get_setting ImageType)

Expand Down

0 comments on commit 4a6cef0

Please sign in to comment.