Skip to content
This repository was archived by the owner on Oct 30, 2026. It is now read-only.

Reuse cached root images during installation - #3

Closed
stuart902 wants to merge 4 commits into
OrchardLinux:mainfrom
stuart902:feat/root-image-cache
Closed

stuart902 wants to merge 4 commits into
OrchardLinux:mainfrom
stuart902:feat/root-image-cache

Conversation

@stuart902

Copy link
Copy Markdown

Summary

Repeated installations of the same image should not require sending the full root archive again. This adds the host-side support for root-image caching.

The CLI asks recovery whether a verified copy of the selected image is already on the device. On a cache hit, it requests local extraction and displays its progress. Otherwise, it transfers the image in full and asks recovery to retain a copy for the next install.

The cache itself is implemented separately in the hardware runtime. This PR adds the CLI negotiation and progress display, while preserving installation support for older recovery images.

Changes

  • Detect recovery's optional root-image cache capability.
  • Check for an exact cached image before choosing local extraction or a full transfer.
  • Include cache storage requirements in installation capacity checks.
  • Display device-local extraction progress with processed bytes, percentage, rate and ETA.
  • Validate progress events and clean up the display on failure without reporting false completion.

Changed images still receive a full transfer. Installation failures are not retried automatically.

Compatibility

Caching requires matching device-side support. Older recovery images continue to use the existing streaming path.

Testing

  • 158 tests pass on Python 3.9, 3.12 and 3.14; type checking and packaging pass.
  • Automated tests cover cache negotiation, hits and misses, changed or corrupt images, older recovery, terminal/non-terminal output and invalid progress events.
  • Paired CLI/runtime tests include Zstandard extraction.
  • Tested on iPad 6 Wi-Fi: initial transfer and caching, followed by cache reuse without a bulk root transfer. Both installations reached system readiness.
  • Continuous local-extraction progress was confirmed on-device, including completion at 1,048 MiB. The observed extraction rate was 16.6 MiB/s; total installation time was not benchmarked.

@stuart902
stuart902 marked this pull request as ready for review October 29, 2026 06:32
@henrikklee

Copy link
Copy Markdown
Contributor

Thanks, Stuart. This is careful work, and the on-device testing is much appreciated. We are closing it because the installer is being replaced: installation moves into a single device-side script in the CLI (installer v2), and runtime/j71b/ goes away. A device-side image cache no longer fits there for two reasons:

  • The new installer transfers data much faster, so re-sending the root image costs little.
  • Keeping the image on the device does not work with the new partition layout: replacing a Linux install erases the partition the cache lived on.

Where the idea fits later is updating an installed system in place. Thanks again!

@henrikklee henrikklee closed this Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants