Skip to content

feat: show one progress bar across the whole install - #29

Open
paviro wants to merge 16 commits into
RepriseOS:mainfrom
paviro:feature/overall-progress
Open

paviro wants to merge 16 commits into
RepriseOS:mainfrom
paviro:feature/overall-progress

Conversation

@paviro

@paviro paviro commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge after #27 (it uses #27's Cargo pin).
Own commits: paviro/repriseos-installer@feature/hfs-helper...feature/overall-progress (the rest of the diff is #27 and below).

The progress bar fills once from 0 to 100 % across all steps of an install or uninstall and only rises; the label names the current step.

Each phase is weighted by its typical seconds on a 6G over USB 2, with decryption the largest. Phases that will be skipped (a reused NOR backup, cached firmware, kept files) leave the total. Uploads weigh about three seconds per file plus a second per MB.

Every event carries progress (0..1) and elapsed_ms, and both are written to events.jsonl. Job::new takes the operation and replaces begin_uninstall. The dev panel's simulated install and uninstall emit the overall figure.

Tested with cargo test and in the dev panel; not run on an iPod.

Installed copies carry the minimum RVX API and target firmware id
from their manifest, in the catalog's "major.minor" and hex forms,
so the frontend can tell which copies the firmware loads.
The active copy is the first one in /Reprise, then /Revola, whose
own API and firmware match the iPod. A copy that does not load, or
whose required library does not, shows why, and browsing offers the
catalog version when that loads. A working copy whose update cannot
load stays Installed, and its details name the release it needs.
API failures name min_repriseos when it is newer than the device,
and installs also reinstall required libraries the firmware skips.
rv_row and rv_menu_entry grew in API 1.86, so a core at that API or
later only loads packages an SDK at 1.86 or later packed, and says
nothing about the ones it skips. The installer judged a copy by the
manifest's minimum API alone, so a Night Shift 0.1.2 packed by SDK
1.84 showed as Installed on such a core.

Installed copies report the SDK that packed them, the device the
floor it applies, and a copy below it reads "Built for an older
RepriseOS". The catalog version is offered when it loads; an entry
whose api is below the floor is as old, since the SDK refuses a
manifest api below its own. The write gate refuses such packages.
Two scenarios mount a simulated iPod with copies in
/Reprise/Extensions/: one on a core at RVX API 1.86, where copies
packed by an older SDK read "Built for an older RepriseOS", and one
on a 1.82 core that loads every build. The mock answers the device
read, writes, removals and the eject; a written package reports the
SDK and minimum API from its bytes, and the eject unmounts the iPod.
The catalog stays live.
The core refuses images an older SDK packed once its API reaches a
layout change: rv_row and rv_menu_entry grew in 1.86, rv_pane grew in
1.89 and rv_pane_extra changed in 1.92. The floor is the last of those
at or below the device's API. The dev-panel scenario and its test use a
1.89 core.
RepriseOS after 0.4.0 keeps extension data (settings and files) under
/Reprise/Data/Extensions/<id>/; 0.4.0 wrote /Revola/Data/Extensions.
When the installer reads an iPod whose firmware is newer than 0.4.0 or
a development build, it moves that folder to /Reprise/Data/Extensions
once. A folder already there is kept and its old copy left behind; an
older firmware's folder is not touched, as it still reads it. The move
runs on the device read, under the edit lock, and a failure only prints.
Release packages built after RepriseOS/repriseos#97 carry no dark_mode
or bitmap_catalog file: Dark Mode lives in the Appearance extension and
the firmware no longer reads /themes. The installer therefore no longer
rebuilds the stock theme pack from the Apple firmware or uploads
/themes/default/theme.bin and /themes/dark/theme.bin. The two upload
stages, their diagnostics entries, the staged copies in the firmware
backup and the disk space reserved for the packs go with it.

An older package that still carries the two files loads as before; the
installer ignores them.
RepriseOS through 0.4.0 reads /themes/default/theme.bin and
/themes/dark/theme.bin; firmware after RepriseOS/repriseos#97 does not,
so an updated iPod keeps two stale packs. When the installer reads a
mounted iPod whose firmware is newer than 0.4.0 or a development build,
it removes the two packs and the folders around them once, on the
device read under the edit lock. Other content under /themes stays with
the folder; an older firmware's packs are not touched, as it still
reads them. Links are not followed and a failure only prints.
RepriseOS after 0.4.0 boots /Reprise/Firmware/reprise.bin and
/Reprise/Firmware/loader.bin. The DFU install uploads both files there,
the loader first and both before the bootloader is flashed, so a
bootloader always finds its files. The helper creates the folders.

The core crates are pinned to the folder layout. They assemble bundles
with the interface classic7g-file-v2 and name the firmware reprise.bin,
as the job test expects, and they refuse a package built for the root
layout, which carries classic7g-file-v1.
A mounted iPod lists when /Reprise/Firmware holds reprise.bin and
loader.bin or, for releases through 0.4.0, when osos-cfw.bin and
cfw-loader.bin sit at the disk root. The folder wins while both exist,
as it does for the bootloader; the firmware version, the device identity
and the change hash come from the files in use.

Once the folder holds both files of a firmware after 0.4.0, the root
files of the earlier install are removed on the device read, under the
edit lock, beside the data and theme cleanups. Links are not followed
and a failure only prints.

The gate reads the folder files. When an update uploaded the folder
files but its bootloader flash did not happen, or the files were copied
into the folder by hand, the old bootloader still boots the root files
and loses them on the next mounted read; the iPod boots RepriseOS again
after the DFU install, which that update needed anyway.
The uninstall command runs in one DFU session: inspect the bootloader,
back up NOR when it is not Apple's, remove the RepriseOS files through
the helper's removal mode, then send the Rockbox dual-boot uninstaller
from the package. Files go first because the RepriseOS bootloader
stops when they are missing; removal is best effort and whatever stays
is reported with the result, so the bootloader is restored either way.
Cancelling stops at the removal: once files are gone the bootloader
has to be restored. With keep_files the files stay for a later install
and only the bootloader changes. When Apple's bootloader is already in
place the command removes the files and restarts the iPod, or, with the
files kept, restarts it and reports that there was nothing to remove.

The install command shares its start, package and device-check steps
with the new one. prepare_package takes the IPSW as an option and
uses the installer's own target without one, which an uninstall needs.
The main screen gains Uninstall RepriseOS. Its screen prepares the
package without an IPSW, offers Keep the RepriseOS files, and leads
into the usual permission, DFU and check steps; the progress and
success screens follow the operation, and the success screen lists
files the iPod would not delete. The dev panel simulates the flow with
an Uninstall group, including the kept-files and leftover cases.
The pinned core's helper publishes HFS+ uploads in batches when the
host sends mode bit 4, removes the installation from HFS+ volumes and
reads uploaded files back under their path. Session::upload_files sends
the batches when the helper manifest carries hfs_batches, so the app
keeps its calls; the reports it saves after a failure cover the batches
whose last file was verified.

The core also counts the catalog and bitmap copies in HFS+ inspection,
closes the file after a failed FAT32 readback and describes the
destination path for both volume formats.
The failure text for helper code -326 applied to the storage stage
only. Removing the files from an HFS+ iPod runs the helper in the
removeFiles stage, where the same code means the same thing: the volume
was not cleanly unmounted and nothing on it was changed. The stage now
gets the same text and the test covers it.
The job weighs each phase by its typical seconds on a 6G over USB 2 and
emits with every event one overall figure that only rises. The bar and
the percentage show that figure across all steps and uploaded files;
the label names the current step.

A phase that will be skipped leaves the total: a reusable NOR backup,
cached decrypted firmware, the uploads of an uninstall and the file
removal of one that keeps the files. Uploads weigh a fixed cost per
file plus bytes, about three seconds per file and a second per MB, in
one helper session or one launch per file for older helpers. Every
journaled event carries elapsed_ms so the weights can be checked
against real runs.

Job::new takes the operation, which names an uninstall before its
first stage and replaces begin_uninstall.

This branch has not been deployed

No deployments
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