Skip to content
Open
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: 4 additions & 2 deletions packages/omamobile-device-husky/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# omamobile-device-husky

Omarchy Mobile's first userspace package for the Google Pixel 8 Pro (codename husky, Tensor G3 / zuma). Like the Pixel Fold's, it hides the Android partitions from desktop tools, holds the USB address, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It does not drive the radio, the charger, or a camera, and it does not mark a boot slot successful.
Omarchy Mobile's first userspace package for the Google Pixel 8 Pro (codename husky, Tensor G3 / zuma). Like the Pixel Fold's, it hides the Android partitions from desktop tools, holds the USB address, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It ships the charger's policy, which stays blacklisted until the kernel work lands, does not drive the radio or a camera, and does not mark a boot slot successful.

| Path | Installs to | What it does |
| --- | --- | --- |
Expand All @@ -16,6 +16,8 @@ Omarchy Mobile's first userspace package for the Google Pixel 8 Pro (codename hu
| `bin/omamobile-usb-rescue` + `vendor/systemd/system/omamobile-usb-rescue.service` | `/usr/bin`, `/usr/lib/systemd/system` (enabled by a vendor wants link) | Keeps the USB link across an unplug. The MAX77759's Type-C side opens its USB2 data switch (TCPC 0x25, register 0x93) on unplug and, with no Type-C driver, nothing closes it again until the bootloader runs: the phone stays off the bus after a replug. While VBUS is valid the script writes 0x09 back (the only register it writes) and logs every change of the switch, VBUS and the UDC state to the journal. It stands aside once a Type-C driver owns 0x25. It needs the hsi2c_11 bus (kernel #163, enabled by a bring-up overlay): without it the script says so and exits. Tested on a Pixel 8 Pro: unplug, replug, the link was back in two seconds with no reboot. Same logic as the Pixel 7 Pro's, on husky's bus |
| `bin/omamobile-husky-aoc-start` + `vendor/systemd/system/omamobile-husky-aoc.service` + `vendor/modprobe.d/omamobile-husky-aoc.conf` | `/usr/bin`, `/usr/lib/systemd/system` (enabled by a vendor wants link), `/usr/lib/modprobe.d` | Starts the AoC audio DSP and the two speaker amplifiers, hang-safe, as the Pixel 7 Pro's `omamobile-aoc-start` does: Trusty, the GSA mailbox, the AoC System MMU, mailbox and core with the firmware load off, the service front ends, the sound card's driver and the CS35L41 amplifiers, then the `aoc.bin` firmware load and a wait for the card. A marker is written and synced before any of it and a start that never returns leaves it behind, so the next boot leaves the AoC off until `omamobile-husky-aoc-start --retry`. The unit is skipped by its condition on a kernel without the AoC node (154b0000.aoc). The modprobe file only blacklists the stack so nothing else loads it out of order; no `speaker_protection` option, the card driver's analog ceiling stays at 10. `aoc.bin` comes from the phone's own vendor partition, never from this package. The kernel side is not merged yet (the Trusty, GSA, AoC and sound card drivers are on the maintainer's list), so today this does nothing on the published kernel |
| `vendor/modprobe.d/omamobile-max77759.conf` | `/usr/lib/modprobe.d` | Keeps max77759_charger, gpio_max77759, nvmem_max77759 and tcpci_maxim from autoloading: binding the PMIC creates the charger cell, which programs charge limits from the battery node. Blacklist only, so a runbook can still load them by hand. The fuel gauge and the MFD core are not blacklisted |
| `vendor/modprobe.d/omamobile-charger.conf` | `/usr/lib/modprobe.d` | The charger's policy, the same two lines as the Pixel 7 Pro and the Pixel 7 (#827): a 500 mA input without a Type-C source (`default_ilim_ua`; without it the upstream driver turns charging off at probe) and stock's temperature bands from the gauge (`temp_guard`), the gauge loading first. Inert for now: the MAX77759 file still blacklists the charger, so these apply only when a runbook loads it by hand. On husky with a published kernel such a load gets the gs201 phones' table (until linux-omarchy-mobile#265), a temperature that reads 22.0 C whatever the cell does (until the gauge fix), and the battery node's 4.20 V, where the charge ends near 82 % (until the float is raised, limits on #761) |
| `bin/omamobile-plugged-inhibit` + `vendor/systemd/system/omamobile-plugged-inhibit.service` + `vendor/udev/rules.d/80-omamobile-charger.rules` | `/usr/bin`, `/usr/lib/systemd/system`, `/usr/lib/udev/rules.d` | Sleep on the cable: holds a logind sleep block while `max77759-charger` is online, since the temperature guard is delayed work that s2idle stops while the chip goes on charging. The udev rule starts it when the charger's power supply appears; it is not enabled at boot, so with the charger blacklisted it never runs. It exits when the charger goes away. Once held, the lock goes only on a `0` or when the file is gone; an empty or failed read keeps holding. Not covered: a cable plugged in while the phone is already asleep, and a suspend within about a second of plug-in (1 s polling) |
| `vendor/systemd/system/plymouth-quit.service.d/10-omamobile-retain-splash.conf` | `/usr/lib/systemd/system/plymouth-quit.service.d` | Makes `plymouth quit` keep its last frame on screen (`--retain-splash`) until Hyprland draws, instead of a black screen. The same three unit lines as cheetah and raven (the comments differ): gs-decon has no fbdev console to hand back, and on raven a plain quit hung for 27 s and held the session back. It only does anything with `splash` on the kernel command line, which husky's descriptor gets from #278; without it Plymouth never runs and the drop-in is inert. Booted from the package on a Pixel 8 Pro (2026-11-02, kernel 7.3.0-rc6-omamobile-push1-g5899fec2bd28): Plymouth started at 3.30 s and its quit, with --retain-splash, finished at 4.94 s without a hang |
| `bin/omamobile-bt-addr` + `vendor/systemd/system/omamobile-bt-addr@.service` + `vendor/udev/rules.d/80-omamobile-bt-addr.rules` | `/usr/bin`, `/usr/lib/systemd/system`, `/usr/lib/udev/rules.d` | Gives the BCM4398 its real Bluetooth address from the bootloader's device tree (`/chosen/config/bt_addr`) when the controller appears, powering it on once first, as on the Pixel 9a. The 9a's script, rule and unit with the chip named; the test checks. Without it the controller keeps its placeholder (43:98:D0:..), the same on every 8 Pro. The address is read at run time and never stored in the package. Bluetooth then comes up powered at every boot |
| `charge-limit.conf` + `vendor/udev/rules.d/75-omamobile-charge-limit.rules` + `vendor/systemd/system/omamobile-charge-limit-apply.service` | `/usr/share/omamobile/charge-limit.conf`, `/usr/lib/udev/rules.d`, `/usr/lib/systemd/system` (not enabled) | Declares that this phone has a charge limit on `max77759-charger` (`supply=max77759-charger`). The Settings app's Battery page and its root helper (omamobile-settings) need this file and do nothing without it, so no other phone gets the page whatever its kernel. When the charger appears, udev pulls in the apply unit, which runs the helper without an argument to put the saved `/etc/omamobile/charge-limit` back on the charger; no saved file, nothing is touched. Since 0.1.16. Inert while `omamobile-max77759.conf` blacklists `max77759_charger`: there is no charger power supply, and the Battery row stays hidden |
Expand All @@ -26,7 +28,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 8 Pro (codename hu

`./build [DIR]` compiles `reboot-to` from this directory, `./install DESTDIR [DIR]` stages the files, and `test/all` checks the copies when it is run from the repository.

Not in this package: the boot-success marker, the charger, cameras, and the slot-B image hook. Those stay out until each one has its own runbook. There is no lid drop-in: husky has no hinge.
Not in this package: the boot-success marker, loading the charger at boot (its options ship, it stays blacklisted until the kernel work lands), cameras, and the slot-B image hook. Those stay out until each one has its own runbook. There is no lid drop-in: husky has no hinge.

## Firmware the phone needs

Expand Down
24 changes: 24 additions & 0 deletions packages/omamobile-device-husky/bin/omamobile-plugged-inhibit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# Hold a logind sleep inhibitor (block) while max77759-charger is online.
# The charger's temperature guard is delayed work: s2idle stops it while the
# chip goes on charging, so the phone must not sleep on the cable.
# udev starts this when the charger's power supply appears
# (80-omamobile-charger.rules); with the charger blacklisted it never
# appears, and this never runs. It exits when the charger goes away.
# Limits: a cable plugged in while already asleep is not covered (nothing
# wakes the phone), and polling is 1 s, so a suspend within about a second
# of plug-in can get through. Once held, the lock goes only on a 0 or when
# the file is gone: an empty or failed read (an I2C error) keeps holding.
C=${OMAMOBILE_CHARGER_ONLINE:-/sys/class/power_supply/max77759-charger/online}
while [ -r "$C" ]; do
if [ "$(cat "$C" 2>/dev/null)" = 1 ]; then
# the lock lives exactly as long as the cable is in
systemd-inhibit --what=sleep --mode=block --who=omamobile-charger \
--why="charging: the charge guard does not run during sleep" \
sh -c 'while [ -e "$1" ] && [ "$(cat "$1" 2>/dev/null)" != 0 ]; do sleep 1; done' _ "$C" \
|| { echo "omamobile-plugged-inhibit: systemd-inhibit failed, sleep is not blocked" >&2; exit 1; }
fi
sleep 1
done
echo "omamobile-plugged-inhibit: $C is gone, stopping" >&2
9 changes: 9 additions & 0 deletions packages/omamobile-device-husky/install
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ ln -sfn ../omamobile-husky-display.service \
"$destination/usr/lib/systemd/system/multi-user.target.wants/omamobile-husky-display.service"
install -Dm644 vendor/modprobe.d/omamobile-max77759.conf \
"$destination/usr/lib/modprobe.d/omamobile-max77759.conf"
# The charger's policy and its sleep blocker; inert while the charger is
# blacklisted: the rule starts the blocker only when the charger binds.
install -Dm644 vendor/modprobe.d/omamobile-charger.conf \
"$destination/usr/lib/modprobe.d/omamobile-charger.conf"
install -Dm755 bin/omamobile-plugged-inhibit "$destination/usr/bin/omamobile-plugged-inhibit"
install -Dm644 vendor/systemd/system/omamobile-plugged-inhibit.service \
"$destination/usr/lib/systemd/system/omamobile-plugged-inhibit.service"
install -Dm644 vendor/udev/rules.d/80-omamobile-charger.rules \
"$destination/usr/lib/udev/rules.d/80-omamobile-charger.rules"
install -Dm755 bin/omamobile-usb-rescue "$destination/usr/bin/omamobile-usb-rescue"
install -Dm644 vendor/systemd/system/omamobile-usb-rescue.service \
"$destination/usr/lib/systemd/system/omamobile-usb-rescue.service"
Expand Down
66 changes: 66 additions & 0 deletions packages/omamobile-device-husky/test/all
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ for f in usr/bin/reboot-to \
usr/lib/systemd/system/omamobile-husky-display.service \
usr/lib/systemd/system/display-manager.service.d/10-omamobile-husky.conf \
usr/lib/modprobe.d/omamobile-max77759.conf \
usr/lib/modprobe.d/omamobile-charger.conf \
usr/bin/omamobile-plugged-inhibit usr/lib/systemd/system/omamobile-plugged-inhibit.service \
usr/lib/udev/rules.d/80-omamobile-charger.rules \
usr/bin/omamobile-usb-rescue \
usr/lib/systemd/system/omamobile-usb-rescue.service \
usr/lib/systemd/system/plymouth-quit.service.d/10-omamobile-retain-splash.conf \
Expand Down Expand Up @@ -144,6 +147,69 @@ for m in max77759_charger tcpci_maxim gpio_max77759 nvmem_max77759; do
done
! grep -qE '^blacklist (max17042_battery|max77759)$' "$conf" || fail "the fuel gauge and the MFD core keep autoloading"
pass "the MAX77759 cell drivers and the Type-C driver are blacklisted, the gauge and the MFD core are not"
# The charger's policy, as on the Pixel 7 Pro and the Pixel 7 (#827): both
# options on one line, the gauge first. Inert: the charger stays blacklisted
# above, so the lines only apply to a modprobe by hand.
mod=$tmp/root/usr/lib/modprobe.d
grep -qx 'options max77759_charger default_ilim_ua=500000 temp_guard=1' "$mod/omamobile-charger.conf" \
|| fail "the charger charges without a Type-C source, under the temperature guard"
grep -qx 'softdep max77759_charger pre: max17042_battery' "$mod/omamobile-charger.conf" \
|| fail "the gauge loads before the charger, for the guard's first reading"
(( $(grep -h '^options max77759_charger' "$mod"/*.conf | wc -l) == 1 )) \
|| fail "one charger options line only"
grep -qx 'blacklist max77759_charger' "$mod/omamobile-max77759.conf" || fail "the charger stays blacklisted until the kernel side is in"
pass "the charger's options and softdep are set, and it stays blacklisted (inert)"
# Sleep on the cable: the blocker starts only when the charger binds, holds
# a block inhibitor while it is online, and is not enabled at boot.
rule=$tmp/root/usr/lib/udev/rules.d/80-omamobile-charger.rules
grep -qx 'ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="max77759-charger", TAG+="systemd", ENV{SYSTEMD_WANTS}+="omamobile-plugged-inhibit.service"' "$rule" \
|| fail "the sleep blocker starts when the charger's power supply appears"
[[ ! -e $tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-plugged-inhibit.service ]] \
|| fail "the sleep blocker is not enabled at boot: it would run with no charger"
sh -n bin/omamobile-plugged-inhibit || fail "the sleep blocker parses"
grep -q '^ExecStart=/usr/bin/omamobile-plugged-inhibit$' vendor/systemd/system/omamobile-plugged-inhibit.service \
|| fail "the blocker unit starts the script"
stub=$tmp/stub; mkdir -p "$stub"
# a stub systemd-inhibit: records its options and pid, then runs the child
cat > "$stub/systemd-inhibit" <<STUB
#!/bin/sh
echo "\$@" >> "$stub/calls"; echo \$\$ > "$stub/child"
while [ "\${1#--}" != "\$1" ]; do shift; done
exec "\$@"
STUB
chmod +x "$stub/systemd-inhibit"
run_blocker() { PATH=$stub:$PATH OMAMOBILE_CHARGER_ONLINE=$tmp/online sh bin/omamobile-plugged-inhibit 2>/dev/null & ipid=$!; }
gone() { for _ in $(seq 34); do kill -0 "$1" 2>/dev/null || return 0; sleep 0.3; done; return 1; }
# no charger: exits at once and blocks nothing
PATH=$stub:$PATH OMAMOBILE_CHARGER_ONLINE=$tmp/no-such-file timeout 5 sh bin/omamobile-plugged-inhibit 2>/dev/null \
|| fail "the blocker exits by itself when there is no charger"
[[ ! -e $stub/calls ]] || fail "the blocker holds nothing without a charger"
# online 0 at start: no lock; the charger going away stops it
echo 0 > "$tmp/online"; run_blocker; sleep 2
[[ ! -e $stub/calls ]] || fail "the blocker takes no lock while the charger is offline"
rm -f "$tmp/online"; gone "$ipid" || { kill "$ipid"; fail "the blocker stops when the charger goes away"; }
wait "$ipid" 2>/dev/null || :
# online 1: the lock is held while the file says 1, released when it says 0
echo 1 > "$tmp/online"; run_blocker
for _ in $(seq 50); do [[ -s $stub/child ]] && break; sleep 0.2; done
child=$(cat "$stub/child" 2>/dev/null); sleep 2
[[ -n $child ]] && kill -0 "$child" 2>/dev/null || { kill "$ipid"; fail "the blocker holds the lock while charging"; }
# an empty or failed read (an I2C error) keeps holding
: > "$tmp/online"; sleep 3
kill -0 "$child" 2>/dev/null || { kill "$ipid"; fail "an empty read keeps the lock"; }
echo 1 > "$tmp/online"; chmod 000 "$tmp/online"; sleep 3
kill -0 "$child" 2>/dev/null || { kill "$ipid"; fail "a failed read keeps the lock"; }
chmod 644 "$tmp/online"
echo 0 > "$tmp/online"
gone "$child" || { kill "$ipid" "$child"; fail "the lock is released when charging stops"; }
rm -f "$tmp/online"; gone "$ipid" || { kill "$ipid"; fail "the blocker stops when the charger goes away"; }
wait "$ipid" 2>/dev/null || :
grep -q -- '--what=sleep --mode=block --who=omamobile-charger' "$stub/calls" || fail "the blocker holds a sleep block while charging"
(( $(wc -l < "$stub/calls") == 1 )) || fail "one lock per plug-in"
unit=vendor/systemd/system/omamobile-plugged-inhibit.service
grep -qx 'StartLimitIntervalSec=0' "$unit" && grep -qx 'RestartSec=5' "$unit" \
|| fail "the blocker unit never hits the start limit and stays failed"
pass "the sleep blocker starts with the charger, blocks sleep while it is online, and does nothing without it"
bash -n bin/omamobile-usb-rescue || fail "the USB rescue parses"
grep -q '10cb0000.i2c' bin/omamobile-usb-rescue || fail "the USB rescue watches husky's bus (hsi2c_11)"
grep -q 'i2cset -f -y "$bus" $tcpc 0x93 0x09' bin/omamobile-usb-rescue || fail "the USB rescue closes the data switch"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: MIT
# Charging policy for max77759_charger, the Pixel 7 Pro's and the Pixel 7's
# two lines. Inert for now: omamobile-max77759.conf still blacklists the
# charger, so these apply only to a modprobe by hand (a runbook step), never
# at boot. Both options belong together:
# - default_ilim_ua: without a Type-C source (tcpci_maxim stays blacklisted)
# the upstream driver turns charging off at probe; this keeps it on at a
# 500 mA input limit instead;
# - temp_guard: stock's step-charging bands from the gauge's temperature
# and voltage, every 30 s; no reading or out of range stops charging.
# The gauge loads first, so the guard's first reading succeeds.
# On husky with a published kernel, a charger loaded by hand is not yet the
# 7 Pro's guard:
# - it gets the gs201 phones' table, until linux-omarchy-mobile#265 gives
# husky its own;
# - the gauge's temperature reads 22.0 C whatever the cell does, until the
# gauge fix lands, so the guard cannot see heat;
# - it charges to the battery node's 4.20 V, where the charge ends near 82 %,
# until the float is raised (the limits on #761).
options max77759_charger default_ilim_ua=500000 temp_guard=1
softdep max77759_charger pre: max17042_battery
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# GPIO and NVMEM cells, and the charger driver programs the charge limits from
# the battery node, so none of the cell drivers may load on their own yet.
# The fuel gauge (max17042_battery) and the MFD core (max77759) still autoload.
# A charger loaded by hand gets its policy from omamobile-charger.conf.
# tcpci_maxim would take over the USB-C port we use for SSH: it waits for the
# Type-C step.
blacklist max77759_charger
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: MIT
[Unit]
Description=Block sleep while charging (the charge guard pauses in s2idle)
Wants=systemd-logind.service
After=systemd-logind.service
StartLimitIntervalSec=0

[Service]
ExecStart=/usr/bin/omamobile-plugged-inhibit
Restart=on-failure
RestartSec=5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: MIT
# Omarchy Mobile: block sleep while the MAX77759 charger is online
# (omamobile-plugged-inhibit.service). Only when the charger driver binds,
# so nothing runs while omamobile-max77759.conf blacklists it.
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="max77759-charger", TAG+="systemd", ENV{SYSTEMD_WANTS}+="omamobile-plugged-inhibit.service"
2 changes: 1 addition & 1 deletion packages/omamobile-device-husky/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.16
0.1.18