From ca09e50081c96889ab06dd926fdfd952c7a3817f Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Tue, 14 Jul 2026 11:25:31 -0500 Subject: [PATCH] Revert "The Final Kachow" This reverts commit 8098b9fa539919273396798d16c1707875d4b431. --- launch_env.sh | 2 +- system/hardware/tici/agnos.json | 6 +- tools/agnos/flash_desktop_system_to_comma.sh | 6 +- tools/agnos/patch_system_reset_image.py | 85 +------------------- tools/agnos/profile_boot.sh | 65 --------------- tools/agnos/test_patch_system_reset_image.py | 43 ---------- 6 files changed, 11 insertions(+), 196 deletions(-) delete mode 100755 tools/agnos/profile_boot.sh delete mode 100644 tools/agnos/test_patch_system_reset_image.py diff --git a/launch_env.sh b/launch_env.sh index f59090dfa..d32295607 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -21,7 +21,7 @@ fi export QCOM_PRIORITY=12 if [ -z "$AGNOS_VERSION" ]; then - export AGNOS_VERSION="12.8.26" + export AGNOS_VERSION="12.8.25" fi if [ -z "$AGNOS_ACCEPTED_VERSIONS" ]; then diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json index b7ae8936e..1620dc9ba 100644 --- a/system/hardware/tici/agnos.json +++ b/system/hardware/tici/agnos.json @@ -67,9 +67,9 @@ }, { "name": "system", - "url": "https://www.dropbox.com/scl/fi/9gkgmosj8etjp1ja3i49s/system6.img.xz?rlkey=mfhofra2he3r7cubjqhwj4pz1&st=aqqgotzj&dl=1", - "hash": "b0dac4105bf4e5cc72dd1e1da6a4482607f8bd5cd59815ead87a942d42cc1f9c", - "hash_raw": "b0dac4105bf4e5cc72dd1e1da6a4482607f8bd5cd59815ead87a942d42cc1f9c", + "url": "https://www.dropbox.com/scl/fi/1c8m8oxxbry7f3muqgymx/system5.img.xz?rlkey=81nx8one4t9912izceskbk3fg&st=z870ynme&dl=1", + "hash": "23280e1073340afe23452627a53269fbdad7251620f722df502de1a071ffd88b", + "hash_raw": "23280e1073340afe23452627a53269fbdad7251620f722df502de1a071ffd88b", "size": 5368709120, "sparse": false, "full_check": false, diff --git a/tools/agnos/flash_desktop_system_to_comma.sh b/tools/agnos/flash_desktop_system_to_comma.sh index 13a0d5b29..f610ce39b 100755 --- a/tools/agnos/flash_desktop_system_to_comma.sh +++ b/tools/agnos/flash_desktop_system_to_comma.sh @@ -2,7 +2,7 @@ set -euo pipefail HOST="${1:-comma@192.168.3.110}" -IMAGE="${2:-/Users/dominickthompson/Desktop/system6.img.xz}" +IMAGE="${2:-/Users/dominickthompson/Desktop/system-23280e1073340afe23452627a53269fbdad7251620f722df502de1a071ffd88b.img.xz}" SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)" @@ -16,8 +16,8 @@ REMOTE_RUNNER="${REMOTE_DIR}/run_flash.sh" REMOTE_AGNOS="${REMOTE_DIR}/agnos.py" PORT="8989" -EXPECTED_VERSION="12.8.26" -RAW_HASH="b0dac4105bf4e5cc72dd1e1da6a4482607f8bd5cd59815ead87a942d42cc1f9c" +EXPECTED_VERSION="12.8.25" +RAW_HASH="23280e1073340afe23452627a53269fbdad7251620f722df502de1a071ffd88b" RAW_SIZE="5368709120" if [[ ! -f "$IMAGE" ]]; then diff --git a/tools/agnos/patch_system_reset_image.py b/tools/agnos/patch_system_reset_image.py index 1350c0731..1e037107a 100644 --- a/tools/agnos/patch_system_reset_image.py +++ b/tools/agnos/patch_system_reset_image.py @@ -38,7 +38,6 @@ SETUP_WIFI_PATCH_MARKER = "JEEPNY_AVAILABLE = True" SETUP_BRANDING_PATCH_MARKER = "STARPILOT_SETUP_BRANDING_V1" SETUP_SSH_RESTORE_PATCH_MARKER = "STARPILOT_SETUP_SSH_RESTORE_V1" WESTON_BG_PATCH_MARKER = "STARPILOT_WESTON_BG_ORIENTATION_V2" -COMMA_SH_DISPLAY_WAIT_PATCH_MARKER = "STARPILOT_DISPLAY_READY_WAIT_V1" JEEPNY_VERSION = "0.9.0" JEEPNY_WHEEL_URL = "https://files.pythonhosted.org/packages/b2/a3/e137168c9c44d18eff0376253da9f1e9234d0239e0ee230d2fee6cea8e55/jeepney-0.9.0-py3-none-any.whl" JEEPNY_WHEEL_SHA256 = "97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683" @@ -156,62 +155,6 @@ def patched_weston_bg_exec_line() -> str: return f"ExecStartPre=/bin/bash -c \"/usr/local/venv/bin/python -c '{python_cmd}'\"" -def patch_comma_sh_display_wait(original: bytes) -> bytes: - text = original.decode("utf-8") - if COMMA_SH_DISPLAY_WAIT_PATCH_MARKER in text: - return original - - old = """echo "waiting for magic" -for i in {1..200}; do - if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - break - fi - sleep 0.1 -done - -if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - echo "magic ready after ${SECONDS}s" -else - echo "timed out waiting for magic, ${SECONDS}s" -fi -""" - new = f"""# {COMMA_SH_DISPLAY_WAIT_PATCH_MARKER} -if systemctl cat magic.service >/dev/null 2>&1; then - echo "waiting for magic" - for i in {{1..200}}; do - if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - break - fi - sleep 0.1 - done - - if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - echo "magic ready after ${{SECONDS}}s" - else - echo "timed out waiting for magic, ${{SECONDS}}s" - fi -else - echo "magic unavailable; waiting for weston" - for i in {{1..200}}; do - if systemctl is-active --quiet weston-ready && [ -S /var/tmp/weston/wayland-0 ]; then - break - fi - sleep 0.1 - done - - if systemctl is-active --quiet weston-ready && [ -S /var/tmp/weston/wayland-0 ]; then - echo "weston ready after ${{SECONDS}}s" - else - echo "timed out waiting for weston, ${{SECONDS}}s" - fi -fi -""" - - if old not in text: - raise RuntimeError("Unable to find comma.sh display readiness wait") - return text.replace(old, new, 1).encode("utf-8") - - def patch_weston_service(original: bytes) -> bytes: text = original.decode("utf-8") if WESTON_BG_PATCH_MARKER in text: @@ -821,15 +764,6 @@ def weston_service_has_expected_content(data: bytes) -> bool: ) -def comma_sh_has_expected_display_wait(data: bytes) -> bool: - return ( - COMMA_SH_DISPLAY_WAIT_PATCH_MARKER.encode("utf-8") in data - and b"systemctl cat magic.service" in data - and b"systemctl is-active --quiet weston-ready" in data - and b"[ -S /var/tmp/weston/wayland-0 ]" in data - ) - - def parse_inode(debugfs_output: str) -> int: m = re.search(r"Inode:\s+(\d+)", debugfs_output) if not m: @@ -1139,12 +1073,12 @@ def main() -> int: MAGIC_PATH_IN_IMAGE: "comma_magic", BG_PATH_IN_IMAGE: "comma_bg", } - expected_hashes: dict[str, str] = {} + preserved_hashes: dict[str, str] = {} for image_path, label in preserved_paths.items(): preserved_file = work_dir / f"{label}.preserved" print(f"Recording existing {image_path} for preservation", flush=True) run_debugfs(debugfs, patched_img, f"dump -p {image_path} {preserved_file}", write=False) - expected_hashes[image_path] = sha256_file(preserved_file) + preserved_hashes[image_path] = sha256_file(preserved_file) original_updater = work_dir / "comma_updater.orig" patched_updater = work_dir / "comma_updater.patched" @@ -1152,15 +1086,6 @@ def main() -> int: original_weston = work_dir / "weston_service.orig" patched_weston = work_dir / "weston_service.patched" verify_weston = work_dir / "weston_service.verify" - patched_comma_sh = work_dir / "comma_sh.patched" - - original_comma_sh = work_dir / "comma_sh.preserved" - comma_sh_patched_data = patch_comma_sh_display_wait(original_comma_sh.read_bytes()) - patched_comma_sh.write_bytes(comma_sh_patched_data) - - print("Writing patched /usr/comma/comma.sh display readiness wait", flush=True) - write_regular_file_to_image(debugfs, patched_img, COMMA_SH_PATH_IN_IMAGE, patched_comma_sh, "100775", 0, 0) - expected_hashes[COMMA_SH_PATH_IN_IMAGE] = sha256_file(patched_comma_sh) print("Extracting weston.service from image", flush=True) run_debugfs(debugfs, patched_img, f"dump -p {WESTON_SERVICE_PATH_IN_IMAGE} {original_weston}", write=False) @@ -1203,10 +1128,8 @@ def main() -> int: for image_path, label in preserved_paths.items(): verify_file = work_dir / f"{label}.verify" run_debugfs(debugfs, patched_img, f"dump -p {image_path} {verify_file}", write=False) - if image_path == COMMA_SH_PATH_IN_IMAGE and not comma_sh_has_expected_display_wait(verify_file.read_bytes()): - raise RuntimeError("comma.sh display readiness verification failed") - if sha256_file(verify_file) != expected_hashes[image_path]: - raise RuntimeError(f"{image_path} does not match the expected generated payload") + if sha256_file(verify_file) != preserved_hashes[image_path]: + raise RuntimeError(f"{image_path} changed unexpectedly; protected StarPilot payload files must stay byte-identical") if args.set_version: version_file = work_dir / "VERSION.patched" diff --git a/tools/agnos/profile_boot.sh b/tools/agnos/profile_boot.sh deleted file mode 100755 index 80108815a..000000000 --- a/tools/agnos/profile_boot.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -HOST="${1:-comma@192.168.3.110}" - -SSH_OPTS=(-o BatchMode=yes -o ConnectTimeout=5) - -if [[ -n "${SSH_KEY:-}" ]]; then - SSH_OPTS+=(-i "$SSH_KEY" -o IdentitiesOnly=yes) -fi - -ssh "${SSH_OPTS[@]}" "$HOST" 'bash -s' <<'REMOTE_SCRIPT' -set -u - -echo "===== Device =====" -printf "AGNOS: " -cat /VERSION -printf "Model: " -tr -d '\000' /dev/null 2>&1; then - echo "Display path: magic.service" -else - echo "Display path: weston fallback (magic.service is not installed)" -fi - -for socket_path in /tmp/drmfd.sock /var/tmp/weston/wayland-0; do - if [[ -S "$socket_path" ]]; then - echo "$socket_path: ready" - else - echo "$socket_path: missing" - fi -done - -echo -echo "===== comma.sh Readiness Logic =====" -if grep -q STARPILOT_DISPLAY_READY_WAIT_V1 /usr/comma/comma.sh; then - sed -n '/STARPILOT_DISPLAY_READY_WAIT_V1/,+50p' /usr/comma/comma.sh -else - sed -n '/waiting for magic/,+20p' /usr/comma/comma.sh - if ! systemctl cat magic.service >/dev/null 2>&1; then - echo "WARNING: comma.sh waits 20 seconds for a service that is not installed" - fi -fi -REMOTE_SCRIPT diff --git a/tools/agnos/test_patch_system_reset_image.py b/tools/agnos/test_patch_system_reset_image.py deleted file mode 100644 index 787317dd5..000000000 --- a/tools/agnos/test_patch_system_reset_image.py +++ /dev/null @@ -1,43 +0,0 @@ -import pytest - -from tools.agnos.patch_system_reset_image import ( - COMMA_SH_DISPLAY_WAIT_PATCH_MARKER, - comma_sh_has_expected_display_wait, - patch_comma_sh_display_wait, -) - - -ORIGINAL_DISPLAY_WAIT = b'''#!/usr/bin/env bash -echo "waiting for magic" -for i in {1..200}; do - if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - break - fi - sleep 0.1 -done - -if systemctl is-active --quiet magic && [ -S /tmp/drmfd.sock ]; then - echo "magic ready after ${SECONDS}s" -else - echo "timed out waiting for magic, ${SECONDS}s" -fi - -exec /data/continue.sh -''' - - -def test_patch_comma_sh_display_wait_uses_available_display_service(): - patched = patch_comma_sh_display_wait(ORIGINAL_DISPLAY_WAIT) - - assert COMMA_SH_DISPLAY_WAIT_PATCH_MARKER.encode() in patched - assert b"systemctl cat magic.service" in patched - assert b"systemctl is-active --quiet magic" in patched - assert b"systemctl is-active --quiet weston-ready" in patched - assert b"[ -S /var/tmp/weston/wayland-0 ]" in patched - assert comma_sh_has_expected_display_wait(patched) - assert patch_comma_sh_display_wait(patched) == patched - - -def test_patch_comma_sh_display_wait_rejects_unknown_layout(): - with pytest.raises(RuntimeError, match="display readiness wait"): - patch_comma_sh_display_wait(b"#!/usr/bin/env bash\nexec /data/continue.sh\n")