Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for resetting the state of blocked ACS firmware update message banner #1207

Open
Dark4Codrutz opened this issue Nov 30, 2024 · 2 comments

Comments

@Dark4Codrutz
Copy link
Contributor

After enabling CWMP without spoofing the latest version the banner appeared for the first time.

image

I tried setting the spoofed version to 2.4.4 and reboot but the banner is still present.
I also tried disabling CWMP

Is there any command I can run to un-toggle whatever is triggering this in the GUI ?

@Dark4Codrutz
Copy link
Contributor Author

Comparing an older exported config with the current one I can see a new section

[cwmp_transfer]
cwmp_transfer.@rollback_info[0]=rollback_info
cwmp_transfer.@rollback_info[0].started='0'
cwmp_transfer.@rollback_info[0].initiator='GUI'
cwmp_transfer.@rollback_info[0].rollback_to='bank_2'

I don't know much about uci so I would really appreciate an input ...

Thanks in advance

@Dark4Codrutz
Copy link
Contributor Author

Dark4Codrutz commented Dec 2, 2024

Found it !

if [ "$TRANSFER_ACTION" = "start" ]; then
E="0"
STARTED=$(get_started "$TRANSFER_ID")
if [ "$STARTED" != "yes" ]; then
URL=$(get_url "$TRANSFER_URL" "$TRANSFER_USERNAME" "$TRANSFER_PASSWORD")
set_started "$TRANSFER_ID" yes "$URL"
uci show $CONFIG
ubus send cwmpd.transfer '{ "session": "begins", "type": "upgrade" }'
if [ "$(uci get -q modgui.var.disable_cwmp_update)" = "1" ]; then
# TIM IS LOVE, TIM IS LIFE. No disclusure for you :D
if echo $TRANSFER_URL | grep -q 'Firmware/TR069/AGThomson'; then
uci set modgui.var.reboot_reason_msg="TIM ACS asked for firmware update. Go to Modgui Settings to allow this."
else
echo "$TRANSFER_URL" "$TRANSFER_USERNAME" "$TRANSFER_PASSWORD" > /tmp/cwmpd_update_request
uci set modgui.var.reboot_reason_msg="ACS asked for firmware update from: $URL Go to Modgui Settings to allow this."
fi
exit 0
else
do_upgrade "$URL"
#if do_upgrade returns, the upgrade failed, remember that
if [ $? -eq 1 ]; then
E="1,download upgrade image failed"
else
E="1,upgrade failed (not a valid signed rbi?)"
fi
fi

The message banner in the GUI is triggered by the reboot_reason_msg option which is set when an firmware upgrade request is being received and disable_cwmp_update is enabled.

The issue is that reboot_reason_msg is never being un-set !

So even if there are no new firmware upgrade requests received, for example when setting the spoofed version post-upgrade request, the message is still being showed.

By removing it with

uci delete modgui.var.reboot_reason_msg

the message banner rightfully disappears and it is not showed anymore as the versione is being spoofed so ACS is not sending anymore upgrade commands.

This will be solved if reboot_reason_msg is being deleted under certain conditions.

A simple such condition would be when we save a spoofed version value.
This way the banner gets removed and if and only if we receive a new firmware upgrade request we get reboot_reason_msg re-assigned.

@Dark4Codrutz Dark4Codrutz changed the title [Q] How to get rid of "A reboot is waiting!" banner at the bottom Allow for resetting the state of blocked ACS firmware update message banner Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant