K2GO-384 feat(backup): byte-accurate progress + ETA - #536
Merged
Conversation
Gives the backup the same determinate bar + honest ETA the restore has; it was an indeterminate spinner. - BackupEngine streams `tar -cf -` (uncompressed) and gzips in Java over the SAF stream, metering the uncompressed bytes tar emits against `du -sb installed-rootfs`. Byte progress tracks the gzip+write time, unlike a member count (which front-loads on small files and stalls on the large ones). Reuses the restore's pure ETA math (ExtractProgress / TransferRate) -- no new strings, tests or fragment change. The Java loop is also the seam a later backup-cancel interrupts. - `--ignore-failed-read`: proot bind-mount stubs (iiab/sdcard, ...) are runtime mounts, not rootfs content, and are unreadable with the box stopped. tar skips them and exits 0. The old `tar | gzip` pipe hit the same read error but reported gzip's exit (0), silently masking tar's exit -- so "successful" backups could drop files unnoticed. Now tar's real exit is honored and skipped entries are logged even on success.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gives the backup the same determinate progress bar + honest ETA the restore
already has — it was an indeterminate spinner.
What changes
BackupEnginestreamstar -cf -(uncompressed) and does the gzip in Javaover the SAF stream, so the uncompressed bytes tar produces are observable and
metered against the tree's total size (
du -sb installed-rootfs). Byteprogress tracks the gzip+write time; a member count front-loads on the many
small files and stalls on the few large ones. Reuses the restore's pure ETA
math (
ExtractProgress/TransferRate) — no new strings, tests or fragmentchange.
DeepOpService.runBackupfeeds progress through the existingDeepOpStatechannel (cancelKind stays NONE; backup's Cancel remains on the notification).
Fixes a latent backup bug
--ignore-failed-readis added because proot bind-mount stubs (iiab/sdcard, …)are runtime mounts, not rootfs content, and are unreadable with the box stopped
("Cannot open: Permission denied"). tar skips them and exits 0.
The old
tar | gzippipe hit the same read error, butwaitFor()returnedgzip's exit (0), silently masking tar's exit — so "successful" backups could
drop files unnoticed. This slice honors tar's real exit and, on success, logs
any entries tar skipped, so a genuinely dropped file is never silent.
Verification
Device (arm64): a backup shows a live bar + honest ETA (~3 min shown, 3:37
actual) and completes; the skipped mount stub is logged. A round-trip —
restoring that backup — extracts successfully, confirming the Java-gzip
.tar.gzis a standard, complete archive.