diff --git a/device/cheetah/NOTES.md b/device/cheetah/NOTES.md index 24c4da253..b8e246ee2 100644 --- a/device/cheetah/NOTES.md +++ b/device/cheetah/NOTES.md @@ -57,6 +57,48 @@ the same day on this phone: installed from release 2026.11.08, it took Omarchy 4.5 and a new boot image from its Updates sheet, the hook wrote and read back slot B, and the phone restarted into it. +## 2026-11-09: power off restarted the phone (the PMIC's WTSR), and the charger boot + +On a second Pixel 7 Pro (a release install with `AUTO_WRITE=yes`), not the +reference phone. + +Kernel `7.3.0-rc6-omamobile-g2219cc6cda77` (the packaged release) and a test +build of it with one change, `7.3.0-rc6-omamobile-push1-g0e3da55c9e9f` +("rtc: s5m: disarm the S2MPG12's WTSR and SMPL restarts at power off"); +`omamobile-device-cheetah` 0.1.45 test builds (0.1.55 here) of the off-mode charging below. +NV partitions checked against the backup first (all SAME). + +- **The PMIC's warm-reset restart is armed** [V]: the RTC regmap + (`firmware:power-management:pmic-1-rtc`, ACPM, one register per read) + reads `0x02` (SMPL) `0x0e`, SMPL_EN 0, and `0x03` (WTSR) `0x0f`, WTSR_EN 1, + on a running phone. Google's `rtc-s2mpg12.c` clears SMPL_EN, WTSR_EN and + COLDRST_EN in its shutdown callback before a power off; `rtc-s5m` didn't. +- **Power off, by the kernel that shuts down** [V]: + | kernel at shutdown | cable | next | + |---|---|---| + | release | in | a normal boot at once (no `androidboot.mode`) | + | test (WTSR disarmed) | in | off, then the bootloader's charger boot (`androidboot.mode = "charger"`) | + | test | out | stayed off for 3 minutes, until Power | + Earlier power offs on the release kernel restarted with the cable out too + (by the owner's memory, not logged). Volume Down + Power forced a reset + into a normal boot: the bootloader enters fastboot only while Volume Down + is still held as it starts (the maintainer's 7 Pro, 2026-11-10), so that + is ordinary, not a fault. +- **The charger boot started the whole phone** [V]: with the cable in, the + bootloader starts slot B with `androidboot.mode = "charger"` (stock runs + only its charging screen then), and we ignored it. With device-cheetah's + `omamobile-charger.target` (0.1.55) that boot runs only charging and SSH: + the panel off (`bl_power` 4), no Plymouth, Bluetooth or camera timer, + nothing failed; Power held for a second restarted into a normal boot, and + the cable out powered it off 5 s later (`charger unplugged: poweroff`). +- **Lesson** [V]: on a phone with `AUTO_WRITE=yes`, installing any package + the boot hook watches (device-cheetah here) rewrote slot B from the + packaged kernel, replacing a pushed test kernel without a word in the + session (`pacman.log`: "Saving slot B (…push1-g0e3da55c9e9f)", then + `boot_b` and `vendor_kernel_boot_b` written). `omamobile-boot-update + rollback` put the test kernel back. Check `omamobile-boot-update status` + before a test that depends on a pushed kernel. + ## 2026-11-09: the 2026.11.08 test install, and an update run as root The release's signed bundle, `omamobile-cheetah-2026.11.08`, installed on the diff --git a/packages/omamobile-device-cheetah/PKGBUILD b/packages/omamobile-device-cheetah/PKGBUILD index 1c8f5d065..ad409389e 100644 --- a/packages/omamobile-device-cheetah/PKGBUILD +++ b/packages/omamobile-device-cheetah/PKGBUILD @@ -7,7 +7,8 @@ pkgdesc="Omarchy Mobile support for the Google Pixel 7 Pro (cheetah): boot-slot arch=(aarch64) url="https://github.com/derekross/omarchy-mobile" license=(MIT Apache-2.0) -depends=(bash systemd util-linux omamobile-keyring i2c-tools) +depends=(bash systemd util-linux omamobile-keyring i2c-tools + python) # omamobile-charger-mode # Keep CPIF and its link driver behind the modem's guarded startup. provides=(omamobile-modem-policy omamobile-sitd-policy) backup=(etc/pacman.d/omamobile-mirrorlist) diff --git a/packages/omamobile-device-cheetah/bin/omamobile-charger-mode b/packages/omamobile-device-cheetah/bin/omamobile-charger-mode new file mode 100755 index 000000000..7ed9aa11a --- /dev/null +++ b/packages/omamobile-device-cheetah/bin/omamobile-charger-mode @@ -0,0 +1,185 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""omamobile-charger-mode: the bootloader's off-mode charging boot, on Linux. + +A Pixel that is off and gets a charger (or is powered off with the cable in) +is started by its bootloader with androidboot.mode = "charger", which on +stock runs only a charging screen. Our boot used to ignore it and start the +whole phone, so a phone powered off on its cable came straight back up. +omamobile-charger-mode-generator makes omamobile-charger.target the default +target of such a boot, and this service runs in it: + + - the panel off (bl_power 4: the display-off set; systemd-backlight + doesn't save it, so the next boot's brightness is untouched), checked + every poll, since the panel driver is a module udev may load after this + starts; + - Power held for a second: restart into the phone (a restart isn't a + charger boot, so the next boot is the normal one); + - the cable out for a few seconds: power off, as stock does. + +It does nothing outside a charger boot, nor in one that started the phone +anyway (multi-user.target active: before this package, or with +/etc/omamobile/charger-mode-disable), where it would turn a running +phone's panel off and restart it on a press of Power. One battery line a minute goes to +the journal. SSH over USB comes up as usual (omamobile-charger.target). +""" +import glob +import os +import select +import shutil +import struct +import subprocess +import sys +import time + +SYS = os.environ.get('OMAMOBILE_SYSFS', '/sys') +BOOTCONFIG = os.environ.get('OMAMOBILE_BOOTCONFIG', '/proc/bootconfig') +SYSTEMCTL = os.environ.get('OMAMOBILE_SYSTEMCTL', 'systemctl') +INPUT = os.environ.get('OMAMOBILE_CHARGER_INPUT', '') +HOLD = float(os.environ.get('OMAMOBILE_CHARGER_HOLD', '1.0')) +UNPLUGGED = float(os.environ.get('OMAMOBILE_CHARGER_UNPLUGGED', '5')) +POLL = float(os.environ.get('OMAMOBILE_CHARGER_POLL', '1')) +REPORT = float(os.environ.get('OMAMOBILE_CHARGER_REPORT', '60')) + +CHARGER = 'max77759-charger' +BATTERY = 'max170xx_battery' +EV_KEY, KEY_POWER = 1, 116 +EVENT = struct.Struct('llHHi') # struct input_event on a 64-bit kernel + + +def log(*words): + print('omamobile-charger-mode:', *words, flush=True) + + +def read(path, default=''): + try: + with open(path) as f: + return f.read().strip() + except OSError: + return default + + +def charger_boot(): + for line in read(BOOTCONFIG).splitlines(): + key, _, value = line.partition('=') + if key.strip() == 'androidboot.mode': + return value.strip().strip('"') == 'charger' + return False + + +def panel_off(failed): + """bl_power 4 on every backlight that doesn't read it yet; a backlight + that refused is logged once (failed) and tried again each poll.""" + for d in sorted(glob.glob(f'{SYS}/class/backlight/*')): + if read(f'{d}/bl_power') == '4': + continue + name = os.path.basename(d) + try: + with open(f'{d}/bl_power', 'w') as f: + f.write('4') + log('panel off:', name) + except OSError as e: + if name not in failed: + log('panel', name, e) + failed.add(name) + + +def has_key(caps, code): + # capabilities/key: hex words, the highest first, 64 bits each. + words = caps.split() + index = len(words) - 1 - code // 64 + return 0 <= index < len(words) and bool(int(words[index], 16) >> (code % 64) & 1) + + +def power_key(): + if INPUT: + return INPUT + for d in sorted(glob.glob(f'{SYS}/class/input/event*')): + if has_key(read(f'{d}/device/capabilities/key'), KEY_POWER): + return f'/dev/input/{os.path.basename(d)}' + return '' + + +def battery(): + b = f'{SYS}/class/power_supply/{BATTERY}' + return f"battery {read(b + '/capacity', '?')}% {read(b + '/status', '?')}" + + +def finish(command, why): + log(why + ':', command) + # systemctl's status, so a refused reboot or power off fails the unit + # and Restart=on-failure brings the loop back instead of a dark phone. + return subprocess.run([SYSTEMCTL, command], check=False).returncode + + +def main(argv): + if not charger_boot(): + log('not a charger boot (androidboot.mode), nothing to do') + return 0 + if subprocess.run([SYSTEMCTL, 'is-active', '--quiet', 'multi-user.target'], + check=False).returncode == 0: + log('the phone is up (multi-user.target), nothing to do') + return 0 + if shutil.which('plymouth'): + subprocess.run(['plymouth', 'quit'], check=False) + failed = set() + panel_off(failed) + path = power_key() + fd = None + if path: + try: + fd = os.open(path, os.O_RDONLY | os.O_NONBLOCK) + except OSError as e: + log('no power key:', path, e) + else: + log('no power key found') + log('charging; hold Power to start the phone,', battery()) + + pending = b'' + pressed = None # when Power went down + seen_online = False # the charger must report once before an unplug counts + unplugged = None # since when it reads offline + reported = time.monotonic() + while True: + now = time.monotonic() + wait = POLL if pressed is None else max(0.0, min(POLL, pressed + HOLD - now)) + if fd is not None and select.select([fd], [], [], wait)[0]: + try: + data = os.read(fd, EVENT.size * 16) + except BlockingIOError: + data = None + if data: + pending += data + while len(pending) >= EVENT.size: + _, _, kind, code, value = EVENT.unpack_from(pending) + pending = pending[EVENT.size:] + if kind == EV_KEY and code == KEY_POWER: + if value == 1 and pressed is None: + pressed = time.monotonic() + elif value == 0: + pressed = None + elif data == b'': + time.sleep(POLL) + elif fd is None: + time.sleep(wait) + + panel_off(failed) + now = time.monotonic() + if pressed is not None and now - pressed >= HOLD: + return finish('reboot', 'Power held') + + online = read(f'{SYS}/class/power_supply/{CHARGER}/online') + if online == '1': + seen_online, unplugged = True, None + elif online == '0' and seen_online: + unplugged = unplugged or now + if now - unplugged >= UNPLUGGED: + return finish('poweroff', 'charger unplugged') + + if now - reported >= REPORT: + log(battery()) + reported = now + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/packages/omamobile-device-cheetah/install b/packages/omamobile-device-cheetah/install index dd17e0143..11fbdc139 100755 --- a/packages/omamobile-device-cheetah/install +++ b/packages/omamobile-device-cheetah/install @@ -13,6 +13,8 @@ for tool in omamobile-bootctl reboot-to; do install -Dm755 "$build/$tool" "$dest while IFS= read -r -d '' file; do install -Dm644 "$file" "$destination/usr/lib/${file#vendor/}" done < <(find vendor -type f -print0) +# systemd runs generators only when they are executable. +chmod 755 "$destination"/usr/lib/systemd/system-generators/* while IFS= read -r -d '' file; do install -d "$destination/usr/lib/$(dirname "${file#vendor/}")" ln -sfn "$(readlink "$file")" "$destination/usr/lib/${file#vendor/}" diff --git a/packages/omamobile-device-cheetah/test/all b/packages/omamobile-device-cheetah/test/all index 01d3b48d3..c8471797b 100755 --- a/packages/omamobile-device-cheetah/test/all +++ b/packages/omamobile-device-cheetah/test/all @@ -8,7 +8,14 @@ fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } pass() { printf 'ok - %s\n' "$1"; } tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT -for script in bin/*; do bash -n "$script" || fail "$script parses"; done +for script in bin/*; do + if head -1 "$script" | grep -c python3 >/dev/null; then + python3 -c 'import ast,sys; ast.parse(open(sys.argv[1]).read())' "$script" || fail "$script parses" + else + bash -n "$script" || fail "$script parses" + fi +done +sh -n vendor/systemd/system-generators/omamobile-charger-mode-generator || fail "the charger-mode generator parses" pass "scripts parse" grep -q '\.\./\.\.' build && fail "build reaches outside the package directory" @@ -376,3 +383,101 @@ grep -A1 -F 'systemctl is-enabled -q omamobile-gnss-nmea.socket' bin/omamobile-s grep -cF -- '--global enable omamobile-geoclue-agent.service' >/dev/null || fail "omamobile-setup-system enables GeoClue's agent with the Location socket" pass "the setup step turns GeoClue's agent on with the Location socket" +# Off-mode charging (0.1.55). The generator makes omamobile-charger.target +# the default of a charger boot only, from the early folder (before /etc), +# and /etc/omamobile/charger-mode-disable turns it off. +gen=vendor/systemd/system-generators/omamobile-charger-mode-generator +[[ -x $tmp/root/usr/lib/systemd/system-generators/omamobile-charger-mode-generator ]] || fail "the generator is staged executable" +c=$tmp/charger; mkdir -p "$c/etc/omamobile" +printf 'androidboot.slot_suffix = "_b"\nandroidboot.mode = "charger"\n' > "$c/charger.bc" +printf 'androidboot.slot_suffix = "_b"\nandroidboot.mode = "normal"\n' > "$c/normal.bc" +OMAMOBILE_ETC=$c/etc OMAMOBILE_BOOTCONFIG=$c/charger.bc sh "$gen" "$c/n1" "$c/e1" "$c/l1" +[[ $(readlink "$c/e1/default.target") == /usr/lib/systemd/system/omamobile-charger.target ]] || fail "a charger boot defaults to omamobile-charger.target" +[[ ! -e $c/n1 && ! -e $c/l1 ]] || fail "the generator writes only its early folder" +for u in plymouth-start.service bluetooth.service omamobile-bt-addr@.service omamobile-camera.timer omamobile-camera.service; do + [[ $(readlink "$c/e1/$u") == /dev/null ]] || fail "a charger boot masks $u" +done +OMAMOBILE_ETC=$c/etc OMAMOBILE_BOOTCONFIG=$c/normal.bc sh "$gen" "$c/n2" "$c/e2" "$c/l2" +[[ ! -e $c/e2/default.target && ! -e $c/e2/bluetooth.service ]] || fail "a normal boot keeps its default target and masks nothing" +OMAMOBILE_ETC=$c/etc OMAMOBILE_BOOTCONFIG=$c/missing sh "$gen" "$c/n3" "$c/e3" "$c/l3" +[[ ! -e $c/e3/default.target ]] || fail "no bootconfig, no change" +touch "$c/etc/omamobile/charger-mode-disable" +OMAMOBILE_ETC=$c/etc OMAMOBILE_BOOTCONFIG=$c/charger.bc sh "$gen" "$c/n4" "$c/e4" "$c/l4" +[[ ! -e $c/e4/default.target ]] || fail "charger-mode-disable turns it off" +t=vendor/systemd/system/omamobile-charger.target +grep -qx 'AllowIsolate=yes' "$t" && grep -qx 'Requires=basic.target' "$t" || fail "the charger target is a basic.target system" +wants=$(sed -n 's/^Wants=//p' "$t") +for u in omamobile-charger.service omamobile-usb-rescue.service omamobile-usb-mac.service sshd.service ufw.service; do + [[ " $wants " == *" $u "* ]] || fail "the charger target wants $u (SSH over USB as on a normal boot)" +done +for u in multi-user graphical omamobile-modem omamobile-wifi omamobile-aoc sddm; do + [[ $wants == *"$u"* ]] && fail "the charger target starts nothing of the phone ($u)" +done +grep -qx 'Restart=on-failure' vendor/systemd/system/omamobile-charger.service || fail "the charger service restarts if it dies" +pass "a charger boot defaults to omamobile-charger.target (early folder, opt-out file) and masks Plymouth, Bluetooth and the camera timer; the target starts only charging and SSH" + +# The service: a fake sysfs, a FIFO for the power key, a systemctl that logs. +s=$c/sys; mkdir -p "$s/class/backlight/panel" "$s/class/power_supply/max77759-charger" "$s/class/power_supply/max170xx_battery" "$c/bin" +echo 0 > "$s/class/backlight/panel/bl_power"; echo 1 > "$s/class/power_supply/max77759-charger/online" +echo 42 > "$s/class/power_supply/max170xx_battery/capacity"; echo Charging > "$s/class/power_supply/max170xx_battery/status" +printf '#!/bin/sh\nif [ "$1" = is-active ]; then [ -e %s ]; exit; fi\necho "$@" >> %s\n[ -e %s ] && exit 1; exit 0\n' "$c/up" "$c/systemctl.log" "$c/refuse" > "$c/bin/systemctl"; chmod +x "$c/bin/systemctl" +# plymouth: a fake, so the test never quits the host's own +printf '#!/bin/sh\necho "$@" >> %s\n' "$c/plymouth.log" > "$c/bin/plymouth"; chmod +x "$c/bin/plymouth" +mkfifo "$c/key"; exec 3<>"$c/key" +key() { python3 -c 'import struct,sys,os; os.write(1, struct.pack("llHHi",0,0,1,116,int(sys.argv[1])))' "$1" >&3; } +charger() { + PATH=$c/bin:/usr/bin:/bin OMAMOBILE_SYSFS=$s OMAMOBILE_BOOTCONFIG=${BC:-$c/charger.bc} OMAMOBILE_SYSTEMCTL=$c/bin/systemctl \ + OMAMOBILE_CHARGER_INPUT=$c/key OMAMOBILE_CHARGER_HOLD=0.4 OMAMOBILE_CHARGER_UNPLUGGED=0.4 OMAMOBILE_CHARGER_POLL=0.05 \ + timeout 10 python3 -I bin/omamobile-charger-mode +} +waitlog() { local i; for i in $(seq 1 60); do [[ -s $c/systemctl.log ]] && return 0; sleep 0.1; done; return 1; } +# Not a charger boot: nothing at all. +out=$(BC=$c/normal.bc charger) || fail "outside a charger boot it exits 0" +[[ ! -e $c/systemctl.log && $(cat "$s/class/backlight/panel/bl_power") == 0 ]] || fail "outside a charger boot it touches nothing: $out" +# A charger boot that started the phone anyway: nothing at all either. +touch "$c/up"; out=$(charger) || fail "with the phone up it exits 0" +[[ ! -e $c/systemctl.log && $(cat "$s/class/backlight/panel/bl_power") == 0 && $out == *"phone is up"* ]] || fail "with the phone up it touches nothing: $out" +rm "$c/up" +# A short press does nothing; Power held restarts; the panel goes off first. +charger > "$c/run1.log" & pid=$! +sleep 0.5; [[ $(cat "$s/class/backlight/panel/bl_power") == 4 ]] || fail "the panel goes off (bl_power 4)" +key 1; sleep 0.1; key 0; sleep 0.6 +[[ ! -e $c/systemctl.log ]] || fail "a short press of Power does nothing" +key 1; waitlog || fail "Power held restarts the phone"; key 0 +wait "$pid" || fail "the service exits 0 after the restart" +[[ $(cat "$c/systemctl.log") == reboot ]] || fail "Power held runs systemctl reboot: $(cat "$c/systemctl.log")" +grep -q 'battery 42% Charging' "$c/run1.log" || fail "the battery goes to the journal" +# Unplugged: offline before the charger ever reported doesn't count; offline +# after it did powers the phone off. +rm -f "$c/systemctl.log"; echo 0 > "$s/class/power_supply/max77759-charger/online" +charger > "$c/run2.log" & pid=$! +sleep 1; [[ ! -e $c/systemctl.log ]] || fail "an offline charger that never reported online is not an unplug" +echo 1 > "$s/class/power_supply/max77759-charger/online"; sleep 0.3 +echo 0 > "$s/class/power_supply/max77759-charger/online" +waitlog || fail "unplugged, the phone powers off" +wait "$pid" || fail "the service exits 0 after the power off" +[[ $(cat "$c/systemctl.log") == poweroff ]] || fail "unplugged runs systemctl poweroff: $(cat "$c/systemctl.log")" +grep -qx quit "$c/plymouth.log" || fail "the boot splash is quit (through the fake plymouth)" +# A refused reboot fails the service (Restart=on-failure brings it back). +rm -f "$c/systemctl.log"; touch "$c/refuse"; echo 1 > "$s/class/power_supply/max77759-charger/online" +charger > "$c/run3.log" & pid=$! +sleep 0.3; key 1; waitlog || fail "Power held asks for the restart"; key 0 +wait "$pid" && fail "a refused restart fails the service" +rm -f "$c/refuse" "$c/systemctl.log" +# The panel driver loads after the service starts: its backlight still goes off. +rm -rf "$s/class/backlight/panel" +charger > "$c/run4.log" & pid=$! +sleep 0.5; mkdir -p "$s/class/backlight/late"; echo 0 > "$s/class/backlight/late/bl_power" +sleep 0.5; [[ $(cat "$s/class/backlight/late/bl_power") == 4 ]] || fail "a backlight that appears late goes off too" +key 1; waitlog || fail "Power held restarts (late backlight run)"; key 0; wait "$pid" +grep -q 'panel off: late' "$c/run4.log" || fail "the late panel's off is logged" +exec 3>&- +# The power key is found from the input devices' key capabilities (gpio-keys +# on the 7 Pro: VOLUMEDOWN, VOLUMEUP and POWER, 114-116). +python3 -I -B - bin/omamobile-charger-mode <<'PY' || fail "KEY_POWER is read from the capability words" +import importlib.machinery, sys +m = importlib.machinery.SourceFileLoader('cm', sys.argv[1]).load_module() +assert m.has_key('1c000000000000 0', 116) and m.has_key('1c000000000000 0', 114) +assert not m.has_key('1c000000000000 0', 113) and not m.has_key('0', 116) and not m.has_key('', 116) +PY +pass "off-mode charging: the panel off, a short press ignored, Power held restarts, unplugged powers off, nothing outside a charger boot or with the phone up" diff --git a/packages/omamobile-device-cheetah/vendor/systemd/system-generators/omamobile-charger-mode-generator b/packages/omamobile-device-cheetah/vendor/systemd/system-generators/omamobile-charger-mode-generator new file mode 100755 index 000000000..2083c7dfd --- /dev/null +++ b/packages/omamobile-device-cheetah/vendor/systemd/system-generators/omamobile-charger-mode-generator @@ -0,0 +1,25 @@ +#!/bin/sh +# SPDX-License-Identifier: MIT +# A boot the bootloader started for off-mode charging (androidboot.mode = +# "charger": the phone was off and got a charger, or was powered off with +# the cable in) runs omamobile-charger.target instead of the phone: the +# panel off, Power held to start, power off when unplugged +# (omamobile-charger-mode). The link goes in the generator's early folder, +# which comes before /etc, so a default set with systemctl set-default +# doesn't start the phone on its cable. systemd.unit= on the command line +# still wins, and /etc/omamobile/charger-mode-disable turns this off. +# The same boot masks what would start anyway without the phone's target: +# Plymouth (the Omarchy logo on a charging phone; the panel goes off +# instead), Bluetooth and its address unit (udev pulls them in for hci0), +# and the camera drivers' load timer. +# Arguments: normal-dir early-dir late-dir (systemd.generator(7)). +early=${2:-} +[ -n "$early" ] || exit 0 +[ -e "${OMAMOBILE_ETC:-/etc}/omamobile/charger-mode-disable" ] && exit 0 +grep -Eq '^androidboot\.mode = "charger"$' "${OMAMOBILE_BOOTCONFIG:-/proc/bootconfig}" 2>/dev/null || exit 0 +mkdir -p "$early" +ln -sfn /usr/lib/systemd/system/omamobile-charger.target "$early/default.target" +for unit in plymouth-start.service bluetooth.service omamobile-bt-addr@.service \ + omamobile-camera.timer omamobile-camera.service; do + ln -sfn /dev/null "$early/$unit" +done diff --git a/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.service b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.service new file mode 100644 index 000000000..168eacc24 --- /dev/null +++ b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.service @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# Off-mode charging: the panel off, Power held for a second to start the +# phone, power off once the cable is out (omamobile-charger-mode). Pulled in +# only by omamobile-charger.target, and the script itself does nothing +# outside a charger boot. +[Unit] +Description=Omarchy Mobile off-mode charging (panel off, hold Power to start) +After=basic.target plymouth-start.service +DefaultDependencies=yes + +[Service] +Type=simple +ExecStart=/usr/bin/omamobile-charger-mode +Restart=on-failure diff --git a/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.target b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.target new file mode 100644 index 000000000..e1b5f3260 --- /dev/null +++ b/packages/omamobile-device-cheetah/vendor/systemd/system/omamobile-charger.target @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: MIT +# The bootloader's off-mode charging boot (androidboot.mode = "charger"), +# the default target of such a boot through +# omamobile-charger-mode-generator: charging with the panel off and nothing +# of the phone started (no session, no modem, no Wi-Fi, no AoC), SSH over +# USB as usual. Power held for a second restarts into the phone. +[Unit] +Description=Omarchy Mobile off-mode charging +Requires=basic.target +Wants=omamobile-charger.service omamobile-usb-rescue.service omamobile-usb-mac.service systemd-networkd.service sshd.service ufw.service +After=basic.target +Conflicts=rescue.service rescue.target +AllowIsolate=yes diff --git a/packages/omamobile-device-cheetah/version b/packages/omamobile-device-cheetah/version index 7b300677b..8893a8e14 100644 --- a/packages/omamobile-device-cheetah/version +++ b/packages/omamobile-device-cheetah/version @@ -1 +1 @@ -0.1.54 +0.1.55