Files
saphid--frame-control/tests/fakeframe/rootfs/usr/local/bin/podman
T
saphidandGPT-6 Astra c06b3285f2 Add Android Steam library artwork and supervised Lepton sessions
Generate five artwork slots, refresh VR shortcuts and managed collections, and retain a signal-aware launcher around setsid so stopping the wrapper cleans its container. Cover installation, artwork and launch cleanup offline; record the Steam client startup blocker for device verification.

Co-Authored-By: GPT-6 Astra <noreply@openai.com>
2026-09-28 21:15:43 +10:00

52 lines
1.5 KiB
Python
Executable File

#!/usr/bin/env python3
"""Stub for podman, for the fake Lepton instances (lepton.py): ps, stop, exec.
`podman ps --format "{{.Names}} {{.Labels.adb_port}}"` lists what's running,
as frame_android.running_instances reads it (docs/apks.md)."""
import os
import sys
import time
sys.path.insert(0, '/usr/local/lib/fakeframe')
import fakeframe_state as fs # noqa: E402
def alive(c):
try:
os.kill(c['pid'], 0)
return True
except OSError:
return False
args = sys.argv[1:]
fs.log('podman', args=args)
cmd = args[0] if args else ''
containers = {n: c for n, c in fs.read()['lepton'].items() if alive(c)}
if cmd == 'ps':
for name, c in sorted(containers.items()):
print(f"{name} {c['port']}")
elif cmd == 'inspect':
if args[-1] not in containers:
sys.exit(1)
print('true')
elif cmd == 'stop':
name = args[-1]
c = containers.get(name)
if not c:
sys.exit(f'Error: no container with name or ID "{name}" found: no such container')
os.kill(c['pid'], 15)
for _ in range(50):
if not alive(c):
break
time.sleep(0.1)
print(name)
elif cmd == 'exec':
name, rest = args[1], ' '.join(args[2:])
if name not in containers:
sys.exit(f'Error: no container with name or ID "{name}" found: no such container')
if 'pidof' in rest:
print(4242) # the app is "up"; there's no Android to ask
# logcat and anything else: nothing to report
else:
sys.exit(f'podman stub: unsupported {args}')