Skip to content
Snippets Groups Projects
Commit d2af837d authored by Vivek Dutta's avatar Vivek Dutta
Browse files

fwbank: Add support to keep_settings

parent 5cc59ecb
No related branches found
No related tags found
1 merge request!524fwbank: Add support to keep_settings
......@@ -22,7 +22,7 @@ fwbank_get_bootbank() {
case "$1" in
list)
echo '{ "dump" : {}, "set_bootbank" : {"bank":32} , "upgrade": {"path":"String","auto_activate":true,"bank":32}}'
echo '{ "dump" : {}, "set_bootbank" : {"bank":32} , "upgrade": {"path":"String","auto_activate":true,"bank":32,"keep_settings":true}}'
;;
call)
case "$2" in
......@@ -126,6 +126,7 @@ case "$1" in
json_get_var path path
json_get_var auto_activate auto_activate
json_get_var bank bank
json_get_var keep_settings keep_settings
ret=0
......@@ -147,6 +148,9 @@ case "$1" in
exit
}
# Set the default value for keep_settings
keep_settings=${keep_settings:-1}
# This ubus call does not reboot the system at any one time.
# Although, the newly upgraded bank is activated by default.
# Thus, pass "--no-reboot" if the bank is to be activated,
......@@ -158,6 +162,11 @@ case "$1" in
sysupgrade_flag="--no-activate"
fi
# Set the flag to do not save configuration over reflash
if [ "${keep_settings}" -eq 0 ]; then
sysupgrade_flag="${sysupgrade_flag} -n"
fi
# Call sysupgrade synchonously. It should not time out the ubus call,
# as it will just verify the image and do an ubus call, leading to
# do_stage2 doing the actual upgrade.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment