Skip to content

phone-provision: --fingerprint restores from a backup directory with a space - #725

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/phone-provision-fingerprint-space
Nov 13, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/phone-provision-fingerprint-space

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

tools/phone-provision --restore DIR --fingerprint stops with no <DIR up to the space> when DIR has a space; without --fingerprint the same DIR works. The backup check listed the fingerprint archive through an unquoted $(...), which split its path. The archives are now an array. It is the same kind of fix as #625 and #646 (a path with a space in the extractors and the installer). I found it reading the code.

--work and a factory image path with a space already work in a dry run; unchanged. Regression test (a stand-in, not the reproduction): tests/phone-provision copies its synthetic backup to a directory with a space and runs the same dry run; on main's tool it fails with not ok - --fingerprint restores from a backup directory with a space.

Device and build

  • Phone: none: laptop tool, dry runs
  • Kernel release (uname -r): not applicable
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes (or the packages I touched: none): n/a, no package changed
  • Each changed package has its version bumped, and the new version is in the commit subject: n/a
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build: no, the check runs before the phone is contacted
  • Runbook steps passed (plan, step, result): none
  • What I did not test: a real restore to a phone, and the suite's container run (no Docker here)
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)
tools/phone-smoke report

Not applicable: no phone ran this change. It is a laptop-side check that runs before the phone is contacted, and CONTRIBUTING.md §6.5 asks for no report for such a tool change.

The real tool from the checkout, a backup like the suite's (made-up contents), a phone stand-in that fails if called, no factory image. My script strips only colour codes. Before, on main (12258d9):

$ tools/phone-provision --dry-run --skip-extract --restore logs/fpps-repro/backup\ with\ space --work logs/fpps-repro/work --user alice --fingerprint
==> Checking the backup in logs/fpps-repro/backup with space
    phone-config.tar: checksum matches
error: no logs/fpps-repro/backup
exit 1

After, this branch:

$ tools/phone-provision --dry-run --skip-extract --restore logs/fpps-repro/backup\ with\ space --work logs/fpps-repro/work --user alice --fingerprint
==> Checking the backup in logs/fpps-repro/backup with space
    phone-config.tar: checksum matches
    var-lib-omandroid-fp.tar: checksum matches
    dry run: the phone isn't contacted; the user is shown as 'alice' (or --user)
==> Restoring this phone's data from the backup
    var/lib/omandroid-vendor/modem/props.conf -> /var/lib/omamobile-vendor/modem/props.conf
    etc/omandroid/modem-nv.sha256 -> /etc/omamobile/modem-nv.sha256
    would push 2 files to / (merge)
==> Fingerprint state
    !! This copies the fingerprint state to /var/lib/omamobile-fp with the
    !! service stopped; it never starts omamobile-fp. Without --restore-td it
    !! copies only the factory calibration copy and the read-only copy of
    !! persist:/ss, never Trusty's TD or the enrolled fingers: a TD older than
    !! the phone's RPMB can't be read (device/cheetah/FINGERPRINT-PLAN.md F19).
    /var/lib/omandroid-fp/persist-ss -> /var/lib/omamobile-fp/persist-ss
    /var/lib/omandroid-fp/persist-ss/0 -> /var/lib/omamobile-fp/persist-ss/0
    /var/lib/omandroid-fp/mfg_data.img -> /var/lib/omamobile-fp/mfg_data.img
    would stop omamobile-fp.service, then restore 3 entries to /var/lib/omamobile-fp
==> Done
    would push 2 files to /
    would restore the fingerprint state
    dry run: nothing was changed on the phone
exit 0

Generated with Claude Opus 5.5 in T3 Code Nightly

…a space

With --restore DIR --fingerprint, the backup check listed the
fingerprint archive through an unquoted command substitution, so a DIR
with a space in it was split there and the run stopped with "no <DIR up
to the space>" before anything was staged. The same DIR works without
--fingerprint, because the config archive was already quoted.

The archives to check are now an array, so each path stays one word.

Tested: the dry run (--dry-run --skip-extract --restore DIR
--fingerprint) from a backup directory with a space, with a phone
stand-in that fails if it is called, stops on main and checks both
archives with this change; --work with a space and a factory image path
with a space also run clean in a dry run. tests/phone-provision gains
that dry run (it fails on main's tool), tools/pr-check origin/main and
tests/all pass. Not tested: a run against a phone, and the suite's
container run (no Docker here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a tidy fix. I checked the rest of phone-provision for the same kind of split and found nothing else: every other path is quoted or inside [[ ]]. I also ran your new case against main's tool in a scratch copy: it fails there with exactly the error you describe and passes with your change, so it guards the fix.

Merging.

@derekross
derekross merged commit 1a28cf3 into derekross:main Nov 13, 2026
2 checks passed
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