Skip to content

Conversation

@ExtremeFiretop
Copy link
Owner

@ExtremeFiretop ExtremeFiretop commented Jun 28, 2025

Patch Gnuton Offline Version Detection

  • Issues found below in detail:

  • Gnuton beta file names are longer and use a different format than our regex currently handles:
    image

  • This means when doing an offline flash, the version is not detected as a "BETA" as found below:
    image

  • However on Merlin builds the detection does work for alpha and beta builds as found below:
    image

  • The end result is the script cannot find the beta file as found below:
    image

2 Fixes introduced:

  1. Allow the Offline Detection function GetOfflineFirmwareVersion to correctly detect and keep _alpha pr _beta suffix tags
  2. Adjust the GetLatestFWUpdateVersionFromGitHub function to work with "pre-release" tagged releases instead of only the "latest" release.

The end result is found below:
-Stable Release Working:
image

-Beta Releases Now working as well:
image

Fix "Offline" Version Detection for Gnuton
@ExtremeFiretop ExtremeFiretop marked this pull request as ready for review June 28, 2025 08:45
@ExtremeFiretop ExtremeFiretop changed the base branch from main to dev June 28, 2025 08:46
@ExtremeFiretop
Copy link
Owner Author

@Martinski4GitHub

To mention this kinda overlaps with the previous PR: #464
But at the time I didn't realize there was more to be done/tweaked/adjusted

@Martinski4GitHub
Copy link
Collaborator

Patch Gnuton Offline Version Detection

* **Issues found below in detail:**

* Gnuton beta file names are longer and use a different format than our regex currently handles:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214323-cd793118-d7ec-4fe7-bdb2-0b3a072b2f68.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDMyMy1jZDc5MzExOC1kN2VjLTRmZTctYmRiMi0wYjNhMDcyYjJmNjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTQ2MmMyNzY2MjRmMjg0NDYwOGVlNDljYTkyNjJlY2NiZWYzZDg5NzM3MTA1MzkyYzc3ZDU4NDJhZjYyY2RkYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.CDa60N6iLVHG7En3i4Aaz115pVrLcwgrDJh2Dlsk-JU)

* This means when doing an offline flash, the version is not detected as a "BETA" as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214351-bef7286c-a690-4dc7-a082-ac7d9b095165.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDM1MS1iZWY3Mjg2Yy1hNjkwLTRkYzctYTA4Mi1hYzdkOWIwOTUxNjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTk4NWU3YzBmMDQ4OWE3MTFhNTdjY2RjNGU4YTUyODliZjczYzQ0ZjYyNmFlYWNlNGY3YmJmYmFmNGFiMjNkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.P1Trs9rtFIwJsxNCyUegD9jzV91UMvikexMzJZ707ZE)

* However on Merlin builds the detection does work for alpha and beta builds as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214389-22531562-23af-40b9-9728-b0afa9900124.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDM4OS0yMjUzMTU2Mi0yM2FmLTQwYjktOTcyOC1iMGFmYTk5MDAxMjQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDIxZjc0ODY1Y2NkMzE0ODJmNTEwNTg3ZTdjMWE1M2JkZTY5MDhlOWUwZmM1NGY4NGUzZDk3MmViYWQ5OTA2OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.lAQj_f8hSwS6ywBM4MZYMb_YiVzC26DPF7JxTRM_vMc)

* The end result is the script cannot find the beta file as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214408-b247bc2c-282b-413d-95e4-e6dff852f05b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDQwOC1iMjQ3YmMyYy0yODJiLTQxM2QtOTVlNC1lNmRmZjg1MmYwNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YThjZjMxZjhkM2E5ZTBmOGU1NDZkZGUzYWU3YjE3ODRlY2MyZjg2NGM0NGIwOGIyZTNkMzczM2MxMjUwN2U4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.htOZ6Zkg86THvMojh-wFQ1OSQSuihBi_xFYvuO2zhI4)

2 Fixes introduced:

1. Allow the Offline Detection function _GetOfflineFirmwareVersion_ to correctly detect and keep _alpha pr _beta suffix tags

2. Adjust the _GetLatestFWUpdateVersionFromGitHub_ function to work with "pre-release" tagged releases instead of only the "latest" release.

The end result is found below: -Stable Release Working: image

-Beta Releases Now working as well: image

Very good catch!! It looks like Gnuton keeps throwing a few "curveballs" with the naming of the image files, especially WRT Alpha and Beta releases :>). But I think you nailed it down this time.

Copy link
Collaborator

@Martinski4GitHub Martinski4GitHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!! Good job, Bud!!

@Martinski4GitHub Martinski4GitHub merged commit a7ac28e into dev Jun 29, 2025
6 of 7 checks passed
@ExtremeFiretop
Copy link
Owner Author

Patch Gnuton Offline Version Detection

* **Issues found below in detail:**

* Gnuton beta file names are longer and use a different format than our regex currently handles:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214323-cd793118-d7ec-4fe7-bdb2-0b3a072b2f68.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDMyMy1jZDc5MzExOC1kN2VjLTRmZTctYmRiMi0wYjNhMDcyYjJmNjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTQ2MmMyNzY2MjRmMjg0NDYwOGVlNDljYTkyNjJlY2NiZWYzZDg5NzM3MTA1MzkyYzc3ZDU4NDJhZjYyY2RkYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.CDa60N6iLVHG7En3i4Aaz115pVrLcwgrDJh2Dlsk-JU)

* This means when doing an offline flash, the version is not detected as a "BETA" as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214351-bef7286c-a690-4dc7-a082-ac7d9b095165.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDM1MS1iZWY3Mjg2Yy1hNjkwLTRkYzctYTA4Mi1hYzdkOWIwOTUxNjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTk4NWU3YzBmMDQ4OWE3MTFhNTdjY2RjNGU4YTUyODliZjczYzQ0ZjYyNmFlYWNlNGY3YmJmYmFmNGFiMjNkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.P1Trs9rtFIwJsxNCyUegD9jzV91UMvikexMzJZ707ZE)

* However on Merlin builds the detection does work for alpha and beta builds as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214389-22531562-23af-40b9-9728-b0afa9900124.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDM4OS0yMjUzMTU2Mi0yM2FmLTQwYjktOTcyOC1iMGFmYTk5MDAxMjQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDIxZjc0ODY1Y2NkMzE0ODJmNTEwNTg3ZTdjMWE1M2JkZTY5MDhlOWUwZmM1NGY4NGUzZDk3MmViYWQ5OTA2OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.lAQj_f8hSwS6ywBM4MZYMb_YiVzC26DPF7JxTRM_vMc)

* The end result is the script cannot find the beta file as found below:
  ![image](https://private-user-images.githubusercontent.com/1971404/460214408-b247bc2c-282b-413d-95e4-e6dff852f05b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTExNzkzOTUsIm5iZiI6MTc1MTE3OTA5NSwicGF0aCI6Ii8xOTcxNDA0LzQ2MDIxNDQwOC1iMjQ3YmMyYy0yODJiLTQxM2QtOTVlNC1lNmRmZjg1MmYwNWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MjlUMDYzODE1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YThjZjMxZjhkM2E5ZTBmOGU1NDZkZGUzYWU3YjE3ODRlY2MyZjg2NGM0NGIwOGIyZTNkMzczM2MxMjUwN2U4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.htOZ6Zkg86THvMojh-wFQ1OSQSuihBi_xFYvuO2zhI4)

2 Fixes introduced:

1. Allow the Offline Detection function _GetOfflineFirmwareVersion_ to correctly detect and keep _alpha pr _beta suffix tags

2. Adjust the _GetLatestFWUpdateVersionFromGitHub_ function to work with "pre-release" tagged releases instead of only the "latest" release.

The end result is found below: -Stable Release Working: image
-Beta Releases Now working as well: image

Very good catch!! It looks like Gnuton keeps throwing a few "curveballs" with the naming of the image files, especially WRT Alpha and Beta releases :>). But I think you nailed it down this time.

While I agree that I might of got the regex closer to right, I now wonder why it's required at all.
I had very "productive" sleep last night and feel very rested and woke up immediately going... Why is the offline feature trying to talk to GitHub? Doesn't that go against the whole "offline" intentions?

Now I'm wondering if instead of patching the function if I should be adjusting the actual offline flow... I'll review more today to see why the logic takes the path it takes for an offline flash.

@ExtremeFiretop
Copy link
Owner Author

@Martinski4GitHub

Is it me or are we only keeping that logic for the
requiredRAM_kb="$(_GetRequiredRAM_KB_ "$release_link" 'phase#x')"
?

We don't use the release_link value it sets for anything else offline.
And the GetOfflineFirmwareVersion function is exporting the required release_version variable when running offline.

So basically; what do you think about changing the flow so the requiredRAM_kb does not rely on the release URL for the memory calculations in offline mode (or even in production online mode) and instead uses the file size of the F/W file locally stored on the router? This would eliminate the need to communicate with any external body when in offline mode, and would technically work with the production online mode as well as long as it's using the downloaded F/W file for the calculations.

The only problem I see with this, which I may need to think more on, is the very first phase of requiredRAM_kb is done before the F/W file is downloaded in production releases. So that theory wouldn't work for that first memory check/phase.

Unless we keep it as is for production and instead modify the requiredRAM_kb to be able to work with a release link or a local file and only use the local file for offline mode... More to think on.

@Martinski4GitHub
Copy link
Collaborator

@Martinski4GitHub

Is it me or are we only keeping that logic for the requiredRAM_kb="$(_GetRequiredRAM_KB_ "$release_link" 'phase#x')" ?

We don't use the release_link value it sets for anything else offline. And the GetOfflineFirmwareVersion function is exporting the required release_version variable when running offline.

So basically; what do you think about changing the flow so the requiredRAM_kb does not rely on the release URL for the memory calculations in offline mode (or even in production online mode) and instead uses the file size of the F/W file locally stored on the router? This would eliminate the need to communicate with any external body when in offline mode, and would technically work with the production online mode as well as long as it's using the downloaded F/W file for the calculations.

The only problem I see with this, which I may need to think more on, is the very first phase of requiredRAM_kb is done before the F/W file is downloaded in production releases. So that theory wouldn't work for that first memory check/phase.

Unless we keep it as is for production and instead modify the requiredRAM_kb to be able to work with a release link or a local file and only use the local file for offline mode... More to think on.

I have an idea where the "_GetRequiredRAM_KB_()" function can be called with a URL parameter or a File Path parameter.
I'll make the changes right now, and then you will be able to adjust the parameter call for the "Offline F/W Update" method.

@ExtremeFiretop ExtremeFiretop deleted the PatchGnutonOffline branch June 30, 2025 23:42
@ExtremeFiretop ExtremeFiretop changed the title Patch Gnuton Version Detection Improved Gnuton Version Detection Jul 6, 2025
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

Successfully merging this pull request may close these issues.

3 participants