Skip to content

Om modern - #6

Open
DefKorns wants to merge 71 commits into
masterfrom
om-modern
Open

DefKorns wants to merge 71 commits into
masterfrom
om-modern

Conversation

@DefKorns

Copy link
Copy Markdown
Owner

No description provided.

DefKorns and others added 29 commits October 22, 2026 14:28
Show the waiting splashes with a moving bar and move the patches out

@marcolinoambrosio marcolinoambrosio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review focused on locale handling, persistence and language installation.

local var_5_4 = var_0_0[var_5_3]
local var_5_5 = table_find_if(arg_5_0.elementArray, function(arg_7_0)
return arg_7_0.language == var_5_4.caption
end)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we guard against var_5_3 being nil here? If the current locale is not present in var_0_0, var_5_4 becomes nil and var_5_4.caption below will fail.

mkdir -p "$cl_home/custom/$cl_pack"
mv "$stage/custom/$cl_pack/$code" "$cl_home/custom/$cl_pack/$code" || rc=1
fi
rm -rf "$stage"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it guaranteed that this path can never install the currently active language? clInstall() stages an active language as <code>.new, but clInstalled() writes directly to <code>. If that invariant is not guaranteed here, could we reuse the same staging logic?

fi
case "$cl_code" in usa_en | eur_de | eur_es | eur_fr | eur_it | eur_nl | eur_pt | eur_ru)
if [ -n "$cl_native" ]; then
rm -f "$cl_dir/active.$cl_system"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What guarantees that the selected stock language has already been persisted by the firmware before we remove active.$cl_system here? Could we add an upgrade test where the previous version has an active stock language and verify that it survives the first reboot?

# the classic mechanism stores the pack, the firmware menu the language
if [ -n "$cl_native" ] && [ -n "$cl_code" ] && [ -d "$cl_dir/custom/$cl_pack/$cl_code" ]; then
cl_code="$(clNativeCode "$cl_code")"
echo "$cl_code" >"$cl_dir/active.$cl_system"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could this migration write be atomic as well? The Lua side explicitly uses mcp.write_file_atomic() for active.*, but this path truncates the persisted state before writing the migrated code. A temporary file plus rename would keep the same persistence guarantee during boot migration.

end)
local var_13_3 = var_0_0[var_13_2]

if var_13_3.extra then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we guard against var_13_2 being nil before dereferencing var_13_3? The visible language slots are dynamically refreshed, so if the selected button no longer maps to an entry in var_0_0, this will fail on var_13_3.extra.

rm -rf "$stage"
translate CL_REPLACE_AT_REBOOT
else
rm -rf "$dest"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we verify that $stage/custom/$cl_pack/$1 exists before removing $dest? Otherwise an archive that unpacks successfully but does not contain the expected directory could remove the currently installed language before the mv fails.

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.

2 participants