Skip to content

tools/phone-install-package: quote the dependencies sent to the phone - #196

Merged
derekross merged 1 commit into
derekross:mainfrom
jkjoplin:tools-phone-install-package-quote
Oct 31, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
jkjoplin:tools-phone-install-package-quote

Conversation

@jkjoplin

Copy link
Copy Markdown
Contributor

What and why

tools/phone-install-package sent the build dependencies to the phone's shell unquoted, as "pacman -T $want". A versioned one is a redirect there.

  • >: with omamobile-omarchy's omarchy>=4.0.6, pacman -T got omarchy and the rest, and its answer went into a file named =4.0.6 in root's home. So missing came back empty, the build-only dependencies were never installed, and makepkg stopped with Could not resolve all dependencies.
  • <: omacam's libcamera<0.8 is an input redirect, so for omacam the shell refused the command outright (0.8: No such file or directory).
  • pacman -S: the install of what is missing was unquoted the same way. It never ran with a version, since missing was always empty when one was there.

I found it while building #171's package on my Pixel 7 Pro to test it. Six packages on main have a versioned dependency, all in depends: omacam, omamessages, omamobile-mmd, omamobile-omarchy, omamobile-shell and omaphone.

The fix:

  • Each dependency now goes to the phone in single quotes.
  • pacman -T prints an unsatisfied dependency as given, version included, and pacman -S takes that form as a target. Checked on the laptop: pacman -Sp 'bash>=5' resolves bash, and pacman -Sp 'bash>=99' gives error: target not found: bash>=99.
  • The quoting makes a second case reachable, so it's in this PR too. pacman -T also names an installed package that is older than a version asks for. Treated as missing, it would be upgraded on its own (a partial upgrade) and marked a dependency by --asdeps. A build-only one would also be removed after the build, although it was there before. The tool now stops before it changes anything: The phone's packages are older than <dep> asks for: update it (omarchy update), then run this again.
  • PHONE_SSH can point the tool at a stand-in phone, as it can for tools/phone-provision.

A decision for you: stopping on a too-old dependency is the cautious choice. If you'd rather have the tool upgrade it, that's pacman -S without --asdeps for those packages, kept out of the removal list.

Test, tests/phone-install-package: the tool runs against a stand-in phone, a local bash with stand-in pacman, makepkg, su, loginctl, getent and chown. No Docker, and it's in tests/all's list, so CI runs it.

  • Case 1: installed runtime dependencies omarchy>=4.0.6 and omarchy<5, and a missing check dependency diffutils>=3.10. Six checks:
    • the build runs (makepkg's Finished making line, not only the exit status);
    • pacman -T gets each versioned dependency as one argument;
    • nothing lands in root's home;
    • the missing one goes in with --asdeps;
    • it goes out again with -Rns;
    • the package is installed.
  • Case 2: diffutils installed but too old. Two checks: the tool stops with the message above, and nothing is installed, built or removed.

Against main's tool with only the PHONE_SSH line added, all eight checks fail. The stand-in's shell prints 5: No such file or directory for omarchy<5. On this branch all eight pass.

Not changed: the tool's exit status doesn't follow makepkg's. makepkg runs on the phone as … | tail -2, so the status that comes back is tail's. In the stand-in run against main's tool, makepkg failed, and the tool went on to pacman -U with the package glob unexpanded and exited 0. It's a separate change, so I left it out; I can send it next if you'd like.

Device and build

  • Phone: Pixel 7 Pro (cheetah), stock CP3A.261005.002.A1 on slot A
  • Kernel release (uname -r): 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be
  • Packages changed, with versions: none (a tool and its test)

Checks (no phone needed)

  • tools/pr-check origin/main passes (7 ok)
  • tests/all passes: 172 ok lines, 3 of them skips (no AOSP mkbootimg under SRC_DIR; no dtc; no root image in out/), no not ok. Without Docker: 170 ok, with the tests/phone-provision container part skipped too.
  • tests/packages: not run, no package changed
  • Each changed package has its version bumped: no package changed
  • Commits have area prefixes and bodies that say why; the AI help is a Co-Authored-By: trailer

On the phone

  • I ran this on my own phone, booted into this build. The tool runs on the laptop. The phone runs the kernel and packages in the report below.
  • The package was omamobile-omarchy 0.1.15 from 7823045, an earlier revision of omamobile-omarchy 0.1.19: fingerprint on the lock only when a finger is enrolled #171 (it merged as 0.1.19). Its checkdepends include diffutils, which the phone didn't have.
    • Before, main's tool:
      • No build dependencies line, and makepkg stopped with ==> ERROR: Could not resolve all dependencies., naming diffutils.
      • Root's home then had a 10-byte file =4.0.6 holding diffutils, the output pacman -T should have returned.
      • I ran a copy of main's tool without its last line (the pacman -U), since at that point I only wanted the build. The copy also ran from another directory, so its cd to the repository named that checkout directly.
    • After, this branch at 0d2e0fc: exit 0 in 23.9 s:
      build dependencies: diffutils
      ==> Leaving fakeroot environment.
      ==> Finished making: omamobile-omarchy 0.1.15-1 (…)
      warning: omamobile-omarchy-0.1.15-1 is up to date -- reinstalling
      reinstalling omamobile-omarchy...
      omamobile-omarchy 0.1.15-1
      removed build dependencies: diffutils
      
      • The phone's pacman.log shows pacman -S --needed --noconfirm --asdeps diffutils, installed diffutils (3.12-2), the reinstall and removed diffutils (3.12-2).
      • Root's home had no file named =* before or after.
      • omamobile-omarchy-patches status still reads result: ok.
      • So the phone ended as it started: the same package, and no diffutils.
    • A too-old dependency, this branch: a throwaway package whose only dependency is bash>=99 (the phone has bash 5.3.20). It printed The phone's packages are older than bash>=99 asks for: update it (omarchy update), then run this again and exited 1. pacman.log gained no line, and I removed its build directory from the phone afterwards.
  • What I did not test:
    • A missing versioned dependency on a real phone. The phone's missing one, diffutils, has no version in this PKGBUILD. The versioned case is tested only with the stand-in, plus the pacman -Sp check above.
    • The other five packages with a versioned dependency.
    • shellcheck: not installed here.
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace. It's a laptop tool that installs packages in the root on userdata.
tools/phone-smoke report

phone-smoke: cheetah

Kernel 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be, tools at 0d2e0fc, 2026-10-30T21:48Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be, slot b, up 62636s
storage guard (required) ok 55 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 97G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card2-DSI-1 connected, 1440x3120
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered false
battery ok 99% Discharging, 32 °C
sound cards ok googleaocsndcar
sensors ok Accelerometer AmbientLight Proximity
cameras ok 4 listed by libcamera
thermal ok hottest zone 32 °C

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.21, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-audio 0.5.4-1, omamobile-device-cheetah 0.1.34-1, omamobile-fingerprint 0.1.8-1, omamobile-firstboot 0.1.2-1, omamobile-gnss 0.2.1-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-modem 0.1.7-1, omamobile-omarchy 0.1.15-1, omamobile-owl-widgets 0.1.1-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.32-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1

🤖 Generated with Claude Code

https://claude.ai/code/session_01TTVics5jHkiz34wzjZWkb9

The build dependencies went to the phone's shell unquoted, as
"pacman -T $want". A versioned one is a redirect there. With
omamobile-omarchy's omarchy>=4.0.6, pacman -T got "omarchy" and the
rest, and its answer went into a file named "=4.0.6" in root's home, so
"missing" came back empty. The build-only dependencies were never
installed, and makepkg stopped with "Could not resolve all
dependencies." On a Pixel 7 Pro, building omamobile-omarchy (its
checkdepends include diffutils, which the phone didn't have) did exactly
that and left /root/=4.0.6 holding "diffutils". omacam's libcamera<0.8
is an input redirect, so for omacam the shell refused the command
outright ("0.8: No such file or directory"). Six packages on main have
a versioned dependency: omacam, omamessages, omamobile-mmd,
omamobile-omarchy, omamobile-shell and omaphone. The "pacman -S" of what
is missing was unquoted the same way; it never ran with a version,
since "missing" was always empty when one was there.

Each dependency now goes in single quotes. pacman -T prints an
unsatisfied dependency as given, version included, and pacman -S takes
that form as a target.

That makes a second case reachable: pacman -T also names an installed
package that is older than a version asks for. Installing it as missing
would upgrade one package on its own (a partial upgrade), mark it as a
dependency with --asdeps, and, for a build-only one, remove it after the
build. The tool now stops before it changes anything and says to update
the phone first.

tests/phone-install-package runs the tool against a stand-in phone: a
local bash with stand-in pacman, makepkg, su, loginctl, getent and
chown. PHONE_SSH points the tool at it, as it does for
tools/phone-provision's tests. Case 1 has installed runtime
dependencies omarchy>=4.0.6 and omarchy<5 and a missing check
dependency diffutils>=3.10. Case 2 has diffutils installed but too old.
Against main's tool with only the PHONE_SSH line added, all eight checks
fail. With this change they pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTVics5jHkiz34wzjZWkb9
@derekross

Copy link
Copy Markdown
Owner

Thanks, this is a great find and a model PR: the before/after on your phone, the mutation check, and keeping the exit-status fix separate. Stopping on a too-old dependency is the right call. Merging; please do send the exit-status fix next.

@derekross
derekross merged commit 3baabf6 into derekross:main Oct 31, 2026
2 checks passed
derekross pushed a commit that referenced this pull request Oct 31, 2026
In a signed release bundle the root image is now bound to the signed MANIFEST (its name and SHA256 digest), and the installer checks the selected image against that record before any fastboot call, so the unsigned .sha256 can no longer vouch for a swapped image. Builds are locked per device and version and published only after they are checked; old bundles' root image lines still parse. Nothing about what is written, the allowlist or the order changes. Maintainer edits: tests/all keeps #196's new test too, and two runbooks use the per-device image names.

Closes #192

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derekross added a commit that referenced this pull request Nov 7, 2026
The matrix re-read against what merged and ran on hardware since 2026-11-02:
- Pixel 7: Bluetooth and the torch move to testing (kernel #196, #197, #426); fingerprint moves to WIP (kernel #207; the package side, #458, is in review); AVB footers and reboot=warm noted.
- Pixel 8a: a new row, from first light and UFS behind the guard (kernel #192, #206; #414).
- Pixel 6 Pro: GPU scaling and cooling (kernel #189) and UFS suspend (kernel #188) merged.
- Pixel 9a: GPU levels merged through kernel #96; GNSS's moving-car session (#114) and the link driver (kernel #185).
- Pixel 7a: Bluetooth's device tree merged (kernel #98).
The Pixel 8 Pro's row is left to #472.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…derekross#196)

The dependency list went to the phone's shell unquoted, so a version constraint such as foo>=1.2 became a redirection and the dependency check passed without checking anything. The list is now quoted, and a missing or too-old dependency stops the install. Tested on the Pixel 7 Pro.
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…#192)

In a signed release bundle the root image is now bound to the signed MANIFEST (its name and SHA256 digest), and the installer checks the selected image against that record before any fastboot call, so the unsigned .sha256 can no longer vouch for a swapped image. Builds are locked per device and version and published only after they are checked; old bundles' root image lines still parse. Nothing about what is written, the allowlist or the order changes. Maintainer edits: tests/all keeps derekross#196's new test too, and two runbooks use the per-device image names.

Closes derekross#192

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
The matrix re-read against what merged and ran on hardware since 2026-11-02:
- Pixel 7: Bluetooth and the torch move to testing (kernel derekross#196, derekross#197, derekross#426); fingerprint moves to WIP (kernel derekross#207; the package side, derekross#458, is in review); AVB footers and reboot=warm noted.
- Pixel 8a: a new row, from first light and UFS behind the guard (kernel derekross#192, derekross#206; derekross#414).
- Pixel 6 Pro: GPU scaling and cooling (kernel derekross#189) and UFS suspend (kernel derekross#188) merged.
- Pixel 9a: GPU levels merged through kernel derekross#96; GNSS's moving-car session (derekross#114) and the link driver (kernel derekross#185).
- Pixel 7a: Bluetooth's device tree merged (kernel derekross#98).
The Pixel 8 Pro's row is left to derekross#472.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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