Skip to content

Commit

Permalink
base-files: sysupgrade: Add new option -s to perform upgrade on curre…
Browse files Browse the repository at this point in the history
…nt partition

Add new option to be able to perform upgrade on current partition for dual firmware devices:
  "-s           stay on current partition (for dual firmware devices)"

Signed-off-by: Paweł Owoc <[email protected]>
  • Loading branch information
testuser7 authored and qosmio committed Nov 14, 2024
1 parent f842f09 commit 9faedbb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package/base-files/files/sbin/sysupgrade
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ CONF_IMAGE=
CONF_BACKUP_LIST=0
CONF_BACKUP=
CONF_RESTORE=
CURR_PARTITION=0
NEED_IMAGE=
HELP=0
TEST=0
Expand Down Expand Up @@ -50,6 +51,7 @@ while [ -n "$1" ]; do
-r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;;
-l|--list-backup) CONF_BACKUP_LIST=1;;
-f) CONF_IMAGE="$2"; shift;;
-s) CURR_PARTITION=1;;
-F|--force) export FORCE=1;;
-T|--test) TEST=1;;
-h|--help) HELP=1; break;;
Expand Down Expand Up @@ -79,6 +81,7 @@ upgrade-option:
-p do not attempt to restore the partition table after flash.
-k include in backup a list of current installed packages at
$INSTALLED_PACKAGES
-s stay on current partition (for dual firmware devices)
-T | --test
Verify image and config .tar.gz but do not actually flash.
-F | --force
Expand Down Expand Up @@ -416,6 +419,7 @@ else
json_add_string command "$COMMAND"
json_add_object options
json_add_int save_partitions "$SAVE_PARTITIONS"
[ $CURR_PARTITION -eq 1 ] && json_add_boolean curr_partition 1
json_close_object

ubus call system sysupgrade "$(json_dump)"
Expand Down

0 comments on commit 9faedbb

Please sign in to comment.