Skip to content

Updater: downloads, checked packages and builds in RAM - #345

Merged
robertnisipeanu merged 1 commit into
mainfrom
emmc-updater
Nov 19, 2026
Merged

robertnisipeanu merged 1 commit into
mainfrom
emmc-updater

Conversation

@robertnisipeanu

@robertnisipeanu robertnisipeanu commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Keeps what the updater only writes to read back and remove out of the head unit's storage.

  • Downloads (the fetch uid's folders), the checked package handed to the deploy tool, and builds on the unit go to scratch_dir (/run/mgu-updater/scratch) when they fit, else state_dir as before. As root that folder is mounted as a tmpfs of its own of scratch_max_bytes (128 MiB), so nothing written there can fill /run; if the mount is refused it is a plain /run folder used only while 64 MiB of /run stay free. Each use also stays within a quarter of the memory available.
  • Root still writes its own copy of the checked bytes for the deploy tool (now in RAM): handing it the fetch uid's file would give root an inode the network-facing uid can still write to.
  • A build gets three times its repo's size (at most build_max_bytes) in RAM. One that outgrows that room, or fails with its file system full, runs again in state_dir.
  • Source listings are written only when what they list changes. The time of each check goes to a small sources/<id>.checked beside the listing, so the Store's "checked" time stays right across restarts. The listing's index memo and the updater's state files are written only when their bytes change.
  • Leftover download and build folders are removed from both places at the start.

Update order: the deploy tool takes the artifact from any path, so this works with the published deploy tool and the other way round.

AI: Claude Code, Claude Opus 5.5

Tested: native/mgu-updater/test/run.sh (Node 8.16.2): all pass, including a new test: a build that outgrows its RAM room runs again in state_dir and installs, and no build or download folder is left. On an iDrive 7 test unit, measuring /var/opt block writes together with the deploy tool change (#344): installing one idrive7-apps app 54 → 41 MB, of which 28 MB is the first fill of the existing blob cache of that repo's files (reused by later installs). Hard power cuts (cache lost) mid-write of the updater's own new version, and the self-update run again afterwards, recovered: the running version kept, the update then committed. Not tested on a car or an iDrive 8 unit.

Human review: no

Screenshots: n/a

🤖 Generated with Claude Code

Downloads, the checked package handed to the deploy tool and builds on
the unit go to a size-capped RAM folder when they fit (state_dir
otherwise). A build that outgrows its room runs again in state_dir.
Source listings and state files are written only when they change; the
time of each check is kept in a small file of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertnisipeanu
robertnisipeanu merged commit 3a62351 into main Nov 19, 2026
1 check passed
@robertnisipeanu
robertnisipeanu deleted the emmc-updater branch November 19, 2026 19:51
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.

1 participant