Replies: 5 comments 2 replies
|
Ultimately, the fix is benign. But I do not understand the insistence (from the AI) that it is right. Has this actually been tested by a real person on a real router to confirm to confirm that the test harness is not the part at fault here? I'm not going to argue with AI any further, but I still don't agree. |
|
"Has this actually been tested by a real person on a real router to confirm to confirm that the test harness is not the part at fault here? I'm not going to argue with AI any further, but I still don't agree." Do you/we discard AI becuase it makes mistakes, people also make mistakes. https://www.theregister.com/ai-and-ml/2026/07/15/linus-torvalds-tells-ai-haters-to-fork-off/5271894 |
|
No, I discard things that aren’t proven and don’t address my concerns. It’s not about the AI. It’s not a lack of trust in the AI, it’s the fact that I need to understand the code that goes into the firmware so I can maintain it. If I can’t reproduce the problem then I don’t understand the issue in the first place or the claimed fix, and I can’t be sure I don’t make the same mistake again. The final response including the research on where the regression is introduced is the proper answer that should have come back the first time. It closes the concern and makes this a change worth backporting to mainline. |
|
Fair enough. point taken. |
|
We are all learning here, please don’t take it personally! |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixed: the first-boot "Initial Settings" page could freeze — an empty timezone/country dropdown and a Save button that spun forever. Root cause was busybox
awkhandling backslash-escaping differently from GNUawk. Resolved in gargoyle #56 (merged 2026-07-13, so it is already in the current test builds).Thanks to Lantis for raising it during the 25.12 fork review.
The symptom
On the first-boot page, the timezone and country dropdowns came up empty and the Save spinner never completed — the password was never saved.
Root cause
The page builds its timezone/country JavaScript arrays by shelling out to
awkwith agsub()that backslash-escapes quotes:awk '{gsub(/"/, "\\\""); print "timezoneLines.push(\""$0"\");"}' ./data/timezones.txtThat
gsubreplacement-string escaping relies on GNU awk semantics. The firmware ships busybox awk (CONFIG_BUSYBOX_CONFIG_AWK=yon every profile), whose replacement-string backslash handling differs — so the inner quotes came through unescaped:The inline
<script>then dies, the timezone data never loads (empty dropdown), and the Save handler throws before it can send its request (eternal spinner).On "couldn't reproduce / check the build environment"
Worth clarifying the mechanism, because it explains the non-reproduction:
awkinvolved is not a build-host tool. It runs at runtime on the router, inside the first-boot CGI page — so nothing in the build environment replaced or altered it. It is the busyboxawkevery image ships.The fix
Switch the escaping from GNU-awk
gsubtosed, which is busybox-safe:Applied to all four affected pages:
package/gargoyle/files/www/firstboot.shpackage/gargoyle-i18n/files/www/firstboot.i18n.shpackage/gargoyle/files/www/time.shpackage/gargoyle/files/www/advanced.shThe i18n variant matters most: an
internationalizebuild mergesfirstboot.i18n.shover the basefirstboot.shto produce the deployed page, so fixing only the base file would still ship the bug. Both are fixed.Validation
The dedicated simulator phase for the first-boot page (
phase32 (firstboot)) — which is the check that originally caught this, including the i18n-variant asymmetry — passes 14/14 on current builds.Status
Merged and shipping. If it's useful to upstream, the
sed-based change is a small, self-contained PR we're happy to send over for review — entirely optional.All reactions