Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/omamobile
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,12 @@ fastboot_serial() {

cmd_fastboot() {
local ssh="$ROOT/tools/phone-ssh" i
load_device
# Qualcomm ABL panic path is uncharacterized on dodge (sysrq-c fallthrough
# when reboot-to bootloader is ignored). Refuse before any phone I/O; use
# the buttons instead (see device/$DEVICE/BRINGUP-M1.md).
[[ $DEV_BOOT_METHOD != qcom-abl ]] ||
die "fastboot refuses BOOT_METHOD=qcom-abl (panic path uncharacterized on this ABL; use the buttons — see device/$DEVICE/BRINGUP-M1.md)"
in_fastboot && { say "Already in fastboot"; return 0; }
for i in $(seq 1 12); do
if adb get-state 2>/dev/null | grep -q device; then
Expand Down
29 changes: 20 additions & 9 deletions device/dodge/BRINGUP-M1.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ the shared storage guard.
may clear the successful bit and refill retries, undoing the GPT bit-54
mark that has no §3.1 entry yet, and `push` cannot see `boot_b` on sde
with today's sda-only lookup. **There is no in-tree day-2 update path for
dodge yet.** The installer PR can reopen those paths with the rest.
dodge yet.** `bin/omamobile fastboot` also refuses: its sysrq-c fallthrough
is uncharacterized on this ABL (see §5). The installer PR can reopen the
flash/push paths with the rest; fastboot stays refused until panic is gated.

## 3. How this phone was installed (record)

Expand Down Expand Up @@ -120,11 +122,13 @@ each session. Those backups are never in git.
`slot-successful:b=yes` the expected path is a reboot back into slot B
rather than falling back to A, but whether this ABL enters a dump mode
first has not been confirmed with a deliberate `sysrq c` on a booted B.
Do not treat "returns to fastboot" as verified until that test is run.
- **Do not use `omamobile fastboot` on this phone yet.** That tool falls
through to `sysrq c` when `reboot-to bootloader` is ignored, and we have
not characterised what a panic does on this ABL. Prefer the buttons
instead of `omamobile fastboot` / sysrq-c. Button behaviour on this phone
Do not treat "returns to fastboot" as verified. That deliberate test is
parked until gated (see below); do not run it.
- **`omamobile fastboot` refuses on this phone.** The tool would fall
through to `sysrq c` when `reboot-to bootloader` is ignored, and panic
behaviour on this ABL is still uncharacterized, so `bin/omamobile` now
refuses `BOOT_METHOD=qcom-abl` before any phone I/O (same class as
`flash` / `push`). Prefer the buttons. Button behaviour on this phone
(Omarchy Mobile on slot B; confirmed 2026-10-31):
- **Forced restart (working):** holding **Power** alone does **not** force
a restart under Omarchy Mobile — it opens the Omarchy power menu
Expand Down Expand Up @@ -204,7 +208,14 @@ never in the repo.

### Still open for §3.1

1. Deliberate panic / `sysrq c` on a booted slot B, then re-read fastboot
slot-successful / unbootable / retry-count for both slots.
2. Concrete GPT restore path that avoids EDL if both copies on sde are bad
1. Concrete GPT restore path that avoids EDL if both copies on sde are bad
(whether `fastboot flash partition:<lun>` works on this ABL).

### Parked until gated

- **Deliberate panic / `sysrq c` on a booted slot B** (then re-read fastboot
slot-successful / unbootable / retry-count for both slots). Not an
actionable step today. Do not run it. It stays parked until there is an
explicit gate (off by default), a documented stop condition, and a
documented way back. Until then, treat panic behaviour on this ABL as
unknown and keep using the buttons instead of any sysrq-c path.
3 changes: 3 additions & 0 deletions device/dodge/audio/install
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ install -Dm755 audio-bringup.sh /usr/local/lib/omamobile/audio-bringup.sh
install -Dm644 omamobile-dodge-audio.service /etc/systemd/system/omamobile-dodge-audio.service
if mountpoint -q /usr/local/lib/omamobile 2>/dev/null; then
tmp=$(mktemp -d)
# Undo the private bind of / on any exit or error (install may fail mid-loop).
trap 'umount "$tmp" 2>/dev/null; rmdir "$tmp" 2>/dev/null' EXIT
mount --bind / "$tmp"
install -Dm755 audio-bringup.sh "$tmp/usr/local/lib/omamobile/audio-bringup.sh"
for d in "$tmp"/usr/local/lib/omamobile.*; do
Expand All @@ -17,6 +19,7 @@ if mountpoint -q /usr/local/lib/omamobile 2>/dev/null; then
done
umount "$tmp"
rmdir "$tmp"
trap - EXIT
fi
systemctl daemon-reload
systemctl enable omamobile-dodge-audio.service || true
Expand Down
3 changes: 3 additions & 0 deletions device/dodge/modem/install
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ install_adsp_battery() {
install -Dm755 adsp-battery.sh /usr/local/lib/omamobile/adsp-battery.sh
mountpoint -q /usr/local/lib/omamobile 2>/dev/null || return 0
tmp=$(mktemp -d)
# Undo the private bind of / on any exit or error (install may fail mid-loop).
trap 'umount "$tmp" 2>/dev/null; rmdir "$tmp" 2>/dev/null' EXIT
mount --bind / "$tmp"
install -Dm755 adsp-battery.sh "$tmp/usr/local/lib/omamobile/adsp-battery.sh"
for d in "$tmp"/usr/local/lib/omamobile.*; do
Expand All @@ -26,6 +28,7 @@ install_adsp_battery() {
done
umount "$tmp"
rmdir "$tmp"
trap - EXIT
}
install_adsp_battery

Expand Down
74 changes: 66 additions & 8 deletions tests/boot-method
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@ grep -q 'push refuses BOOT_METHOD=qcom-abl' "$t/log" || fail "push did not refus
[[ ! -e $t/calls ]] || fail "qcom-abl push accessed the phone"
echo 'ok - BOOT_METHOD=qcom-abl refused by push before phone access'

# Same class: fastboot refuses qcom-abl before any phone I/O (no sysrq-c).
rm -f "$t/calls"
if DEVICE=abldev "$t/repo/bin/omamobile" fastboot > "$t/log" 2>&1; then fail "fastboot unexpectedly accepted qcom-abl"; fi
grep -q 'fastboot refuses BOOT_METHOD=qcom-abl' "$t/log" || fail "fastboot did not refuse qcom-abl"
[[ ! -e $t/calls ]] || fail "qcom-abl fastboot accessed the phone"
echo 'ok - BOOT_METHOD=qcom-abl refused by fastboot before phone access'

# Non-qcom descriptor must get past the refuse. Make fastboot report a
# phone already in fastboot so cmd_fastboot returns before the reboot loop.
rm -f "$t/calls"
mkdir -p "$t/repo/device/cheetah"
cp device/cheetah/device.conf "$t/repo/device/cheetah/"
printf '#!/bin/sh\necho "SERIAL\tfastboot"\n' > "$t/bin/fastboot"
chmod +x "$t/bin/fastboot"
if ! DEVICE=cheetah "$t/repo/bin/omamobile" fastboot > "$t/log" 2>&1; then
fail "android-v4 fastboot should succeed when already in fastboot: $(cat "$t/log")"
fi
grep -q 'fastboot refuses BOOT_METHOD=qcom-abl' "$t/log" \
&& fail "android-v4 cheetah was refused as qcom-abl"
grep -q 'Already in fastboot' "$t/log" \
|| fail "android-v4 fastboot did not take the already-in path: $(cat "$t/log")"
# Restore the "any phone command is a failure" stub for later checks.
printf '#!/bin/sh\necho called >> "$CALLS"\nexit 97\n' > "$t/bin/fastboot"
chmod +x "$t/bin/fastboot"
echo 'ok - BOOT_METHOD=android-v4 (cheetah) gets past fastboot qcom-abl refuse'

# dodge-chain must refuse a stage-1 Image as STAGE2_IMAGE (nested pack → ~87MiB hang).
cp tools/dodge-chain "$t/repo/tools/"
# Fake "Image" carrying the stage-1 cmdline marker (strings fallback when no ikconfig).
Expand Down Expand Up @@ -433,14 +459,46 @@ grep -q 'mount -t tmpfs' "$tip" \
|| fail "tip-modules-overlay must mount tmpfs for RAM-only extract"
echo "ok - kmod-overlay tip path + tip-modules-overlay present"

# Dual-write installs must use a private bind of / (not only omamobile.*).
grep -q 'mount --bind /' device/dodge/modem/install \
|| fail "modem/install must private-bind / to write through kmod-overlay"
grep -q 'mount --bind /' device/dodge/audio/install \
|| fail "audio/install must private-bind / to write through kmod-overlay"
grep -q 'omamobile-tip-sddm.bounced' device/dodge/kernel/omamobile-tip-modules-overlay \
|| fail "tip-modules-overlay must stamp sddm bounce"
echo "ok - dual-write private-bind + sddm bounce stamp"
# Dual-write installs must use a private bind of / (not only omamobile.*),
# and undo that bind in an EXIT trap so a mid-install failure cannot leave /
# bound under a leftover tmpdir.
for inst in device/dodge/modem/install device/dodge/audio/install; do
grep -q 'mount --bind /' "$inst" || fail "$inst must private-bind / to write through kmod-overlay"
grep -q "trap 'umount" "$inst" || fail "$inst must trap-umount the private bind of / on exit/error"
done
grep -q 'omamobile-tip-sddm.bounced' device/dodge/kernel/omamobile-tip-modules-overlay || fail "tip-modules-overlay must stamp sddm bounce"
echo "ok - dual-write private-bind + cleanup trap + sddm bounce stamp"

# Runtime: audio/install's private bind must be umounted when install fails
# after mount --bind /. Fake mountpoint/mktemp/mount/install/systemctl.
tbind=$t/bind-trap
rm -rf "$tbind"
mkdir -p "$tbind/bin" "$tbind/src"
: > "$tbind/log"
printf '%s\n' '#!/bin/sh' 'exit 0' > "$tbind/bin/mountpoint"
printf '%s\n' '#!/bin/sh' "d=$tbind/tmpbind; mkdir -p \"\$d\"; echo \"\$d\"" > "$tbind/bin/mktemp"
printf '%s\n' '#!/bin/sh' "echo mount:\"\$*\" >> \"$tbind/log\"" "mkdir -p \"$tbind/tmpbind/usr/local/lib/omamobile\" \"$tbind/tmpbind/usr/local/lib/omamobile.fake\"" 'exit 0' > "$tbind/bin/mount"
printf '%s\n' '#!/bin/sh' "echo umount:\"\$*\" >> \"$tbind/log\"" 'exit 0' > "$tbind/bin/umount"
printf '%s\n' '#!/bin/sh' "echo rmdir:\"\$*\" >> \"$tbind/log\"" 'exit 0' > "$tbind/bin/rmdir"
# First install (live path) succeeds; any install into the bind tmp fails.
printf '%s\n' '#!/bin/sh' "echo install:\"\$*\" >> \"$tbind/log\"" "case \"\$*\" in *$tbind/tmpbind*) echo forced-fail >&2; exit 1 ;; esac" 'exit 0' > "$tbind/bin/install"
printf '%s\n' '#!/bin/sh' "echo systemctl:\"\$*\" >> \"$tbind/log\"" 'exit 0' > "$tbind/bin/systemctl"
chmod +x "$tbind/bin"/*
cp device/dodge/audio/install "$tbind/src/install"
cp device/dodge/audio/audio-bringup.sh "$tbind/src/" 2>/dev/null || printf '#!/bin/sh\n' > "$tbind/src/audio-bringup.sh"
cp device/dodge/audio/omamobile-dodge-audio.service "$tbind/src/" 2>/dev/null || : > "$tbind/src/omamobile-dodge-audio.service"
chmod +x "$tbind/src/install"
# Fake id as root so any root check passes (audio/install has none; keep for modem reuse).
printf '%s\n' '#!/bin/sh' 'echo 0' > "$tbind/bin/id"
chmod +x "$tbind/bin/id"
set +e
PATH="$tbind/bin:/usr/bin:/bin" "$tbind/src/install" >"$tbind/out" 2>&1
rc=$?
set -e
[[ $rc -ne 0 ]] || { cat "$tbind/out" "$tbind/log"; fail "audio/install should fail when bind-path install fails"; }
grep -q 'mount:--bind /' "$tbind/log" || { cat "$tbind/log" "$tbind/out"; fail "audio/install should mount --bind /"; }
grep -q 'umount:' "$tbind/log" || { cat "$tbind/log" "$tbind/out"; fail "audio/install trap must umount on failure after bind"; }
echo "ok - audio/install undoes private bind of / on failure"


# Runtime: adsp-battery prefers modprobe when it succeeds.
Expand Down