Skip to content

install-phone: say so when the work directory can't be created or written - #681

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/install-phone-work-dir-message
Nov 12, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/install-phone-work-dir-message

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

This follows the maintainer's note on #648: --verify-only now creates the work directory, so on a home that can't be written it stops at mktemp rather than with a message of the installer's.

Since #648 the shipped ramdisk is read in a directory of its own in --work before the phone is contacted. When --work (by default ~/.cache/omamobile-install) can't be created or written, the run stopped at mkdir's or mktemp's own error. I made that mkdir/mktemp line end in a die that names the work directory and --work DIR. A full install stops at the same line, before the phone. The later mkdir -p and chmod 700 of --work only run after this line has worked (every installable descriptor has a vendor ramdisk), so I left them alone.

Before (origin/main e163141) and after (this branch): a bundle laid out as tools/make-bundle lays it out, its install taken from each revision, run in a bwrap sandbox with the checkout at /mnt. Only fastboot is faked. The faults come from outside: the home is bound read-only and locked/ is mode 555. My script strips the colour codes and filters the full install's output through the grep shown, nothing else. This laptop has uutils coreutils, whose mkdir doesn't name the path.

Before:

$ git rev-parse --short origin/main   # the bundle's install is this revision's tools/install-phone
e1631410
(bundle install == origin/main:tools/install-phone)
$ touch ~/probe; ls -ld locked   # inside the sandbox: the home is read-only, locked/ is r-x
touch: cannot touch '/mnt/logs/repro/fvo2a-origin-main/home/probe': Read-only file system
dr-xr-xr-x

$ cd bundle/omamobile-twelve-2026.11.09
$ ./install --unsigned --verify-only   # the default work directory, under the read-only home
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mkdir: Read-only file system
exit=1; fastboot calls: 0

$ ./install --unsigned --verify-only --work /mnt/logs/repro/fvo2a-origin-main/locked/work   # a --work under a directory the user can't write
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mkdir: Permission denied
exit=1; fastboot calls: 0

$ ./install --unsigned --verify-only --work /mnt/logs/repro/fvo2a-origin-main/locked   # a --work that exists but can't be written
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mktemp: Permission denied (os error 13) at path "/mnt/logs/repro/fvo2a-origin-main/locked/verify.wgl3Tb"
exit=1; fastboot calls: 0

$ ./install --unsigned | grep -E '==>|error|mkdir|mktemp'   # the full install, read-only home, answers on stdin
==> Checking the files (bundle mode)
mkdir: Read-only file system
exit=1; fastboot calls: 0; partitions flashed: 0

After:

$ git rev-parse --short install-phone-work-dir-message   # the bundle's install is this revision's tools/install-phone
28bb5131
(bundle install == install-phone-work-dir-message:tools/install-phone)
$ touch ~/probe; ls -ld locked   # inside the sandbox: the home is read-only, locked/ is r-x
touch: cannot touch '/mnt/logs/repro/fvo2a-install-phone-work-dir-message/home/probe': Read-only file system
dr-xr-xr-x

$ cd bundle/omamobile-twelve-2026.11.09
$ ./install --unsigned --verify-only   # the default work directory, under the read-only home
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mkdir: Read-only file system
error: can't create or write to the work directory /mnt/logs/repro/fvo2a-install-phone-work-dir-message/home/.cache/omamobile-install (give one you can write to with --work DIR)
exit=1; fastboot calls: 0

$ ./install --unsigned --verify-only --work /mnt/logs/repro/fvo2a-install-phone-work-dir-message/locked/work   # a --work under a directory the user can't write
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mkdir: Permission denied
error: can't create or write to the work directory /mnt/logs/repro/fvo2a-install-phone-work-dir-message/locked/work (give one you can write to with --work DIR)
exit=1; fastboot calls: 0

$ ./install --unsigned --verify-only --work /mnt/logs/repro/fvo2a-install-phone-work-dir-message/locked   # a --work that exists but can't be written
==> Checking the files (bundle mode)
    unsigned bundle (--unsigned)
    bundle checksums match
    manifest.json: Omarchy Mobile 2026.11.09 (developer preview), its plan matches the descriptor
    root image checksum matches
    kernel 7.3.0-rc6-omamobile-gaaaaaaaaaaaa, its modules in the root image
mktemp: Permission denied (os error 13) at path "/mnt/logs/repro/fvo2a-install-phone-work-dir-message/locked/verify.twpuFw"
error: can't create or write to the work directory /mnt/logs/repro/fvo2a-install-phone-work-dir-message/locked (give one you can write to with --work DIR)
exit=1; fastboot calls: 0

$ ./install --unsigned | grep -E '==>|error|mkdir|mktemp'   # the full install, read-only home, answers on stdin
==> Checking the files (bundle mode)
mkdir: Read-only file system
error: can't create or write to the work directory /mnt/logs/repro/fvo2a-install-phone-work-dir-message/home/.cache/omamobile-install (give one you can write to with --work DIR)
exit=1; fastboot calls: 0; partitions flashed: 0

Regression test (a stand-in, not the reproduction): tests/install-phone-initramfs adds a --work under a mode 555 directory and a --work that is one, each with --verify-only, plus a full install with the second. Each must stop with the message and contact no phone. With main's tool it fails at "says why it refuses a --work that can't be created with --verify-only". Guarding only mkdir, only mktemp, or dropping the directory from the message each fail it too. Root can write a mode 555 directory, so the case is skipped as root.

The body is longer than usual because of the two transcripts.

Device and build

  • Phone: none: the laptop-side installer only
  • 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/install-phone-initramfs also under umask 077, 022 and 002)
  • tests/packages passes (or the packages I touched: ...): not run, no package changed
  • Each changed package has its version bumped, and the new version is in the commit subject: no package changed
  • 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 change stops before the phone is contacted
  • Runbook steps passed (plan, step, result): none, no plan step
  • What I did not test: a phone; the case as root; GNU coreutils' wording of the raw line above the message
  • 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: a laptop-side installer change that stops before the phone is contacted.

Generated with Claude Opus 5.5 in T3 Code Nightly

…tten

Since derekross#648 the shipped ramdisk is read in a directory of its own in
--work before the phone is contacted, so --verify-only now creates the
work directory. On a home that can't be written (or with a --work the
user can't write) it stopped at mkdir's or mktemp's own error, which
with uutils coreutils doesn't even name the path. It now stops with the
installer's message, naming the work directory and --work DIR. A full
install stops there too, before the phone; the later mkdir and chmod of
--work only run after this one has succeeded, so they are left alone.

Tested: tests/install-phone-initramfs gains the case (a --work under a
directory the user can't write, a --work that exists but can't be
written, both with --verify-only, and a full install), which fails with
main's tool ("says why it refuses a --work that can't be created");
both install-phone suites pass, the initramfs one under umask 077, 022
and 002; tools/pr-check origin/main; tests/all. A bundle's
./install --unsigned --verify-only in a sandbox with a read-only home
now ends with the message. Not tested: on a phone (laptop-side only),
or as root (the test skips its case there; root can write a mode 555
directory).

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

Copy link
Copy Markdown
Owner

Thanks, @only21mil. That is the second of the two small things I noted on #648, and it is done in the one place that matters: both --verify-only and a full install now stop there with a message of ours that names the directory and --work DIR, before the phone is contacted.

I checked it merged onto today's main: tools/pr-check and both install-phone suites pass, and with main's tool under your test it fails at "says why it refuses a --work that can't be created with --verify-only", as you say. It also sits cleanly next to #682; the two together pass the suite.

One note for later, nothing to change here: the mkdir -p "$work" further down is covered by this line only for a phone whose ramdisk is in vendor_boot or vendor_kernel_boot. That is every phone the installer accepts today; a boot-image-only phone would need the same message there once it becomes installable.

Merging.

@derekross
derekross merged commit 067b1c8 into derekross:main Nov 12, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…tten (derekross#681)

Since derekross#648 the shipped ramdisk is read in a directory of its own in --work before the phone is contacted, so --verify-only creates the work directory; on a home that can't be written the run stopped at mkdir's or mktemp's own error, which with uutils coreutils doesn't name the path. It now stops with the installer's message, naming the directory and --work DIR, before the phone. tests/install-phone-initramfs covers a --work that can't be created and one that can't be written.

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