From 4f3cbd21b8991612c2165b01121e215dfa006d08 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 22 Jan 2025 16:50:37 -0800 Subject: [PATCH] Remove firwmare.json (#432) * Remove firwmare.json * match order --- README.md | 2 +- flash_all.sh | 8 +++----- scripts/ota_push.sh | 6 +----- scripts/package_ota.py | 31 ++++++++----------------------- 4 files changed, 13 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 12ea94d..4f62c4d 100644 --- a/README.md +++ b/README.md @@ -82,5 +82,5 @@ Some concrete things on the roadmap: - [x] update to Ubuntu 24.04 https://github.com/commaai/openpilot/issues/32386 - [ ] mainline Linux kernel https://github.com/commaai/openpilot/issues/32386 - [ ] fully open source - - [ ] anything from [firmware.json](firmware.json): XBL, ABL, etc. + - [ ] anything from `firmware/`: XBL, ABL, etc. - [ ] Weston https://github.com/commaai/agnos-builder/issues/16 diff --git a/flash_all.sh b/flash_all.sh index 8fef907..ade4e93 100755 --- a/flash_all.sh +++ b/flash_all.sh @@ -4,11 +4,9 @@ set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" cd $DIR -DOWNLOADED="aop abl xbl xbl_config devcfg" -scripts/download-from-manifest.py --manifest firmware.json -for part in $DOWNLOADED; do - tools/edl w ${part}_a $DIR/output/$part.img - tools/edl w ${part}_b $DIR/output/$part.img +for part in aop abl xbl xbl_config devcfg; do + tools/edl w ${part}_a $DIR/firmware/$part.bin + tools/edl w ${part}_b $DIR/firmware/$part.bin done ./flash_kernel.sh diff --git a/scripts/ota_push.sh b/scripts/ota_push.sh index 5302a3a..ec30f25 100755 --- a/scripts/ota_push.sh +++ b/scripts/ota_push.sh @@ -49,11 +49,7 @@ DATA_SAS_TOKEN=$(az storage container generate-sas --as-user --auth-mode login - # Liftoff! for name in $(cat $OTA_JSON | jq -r ".[] .name"); do - if grep -q "name.*${name}" $DIR/../firmware.json; then - echo "Skipping $name, found in firmware.json" - else - process_file $name - fi + process_file $name done echo "Done!" diff --git a/scripts/package_ota.py b/scripts/package_ota.py index eca967e..1f49d80 100755 --- a/scripts/package_ota.py +++ b/scripts/package_ota.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -import sys import json import os import hashlib @@ -9,6 +8,7 @@ from pathlib import Path ROOT = Path(__file__).parent.parent OUTPUT_DIR = ROOT / "output" +FIRMWARE_DIR = ROOT / "firmware" OTA_OUTPUT_DIR = OUTPUT_DIR / "ota" BUILD_DIR = ROOT / "build" @@ -53,28 +53,13 @@ def process_file(fn, name, full_check=True, has_ab=True): if __name__ == "__main__": OTA_OUTPUT_DIR.mkdir(parents=True, exist_ok=True) - if len(sys.argv[1:]): - files = [process_file(Path(fn), Path(fn).stem) for fn in sys.argv[1:]] - else: - files = [ - process_file(OUTPUT_DIR / "boot.img", "boot"), - process_file(OUTPUT_DIR / "system.img", "system", full_check=False), - ] - - # pull in firmware not built in this repo - with open(ROOT/"firmware.json") as f: - fws = json.loads(f.read()) - for fw in fws: - files.append({ - "name": fw["name"], - "url": fw["url"], - "hash": fw["hash"], - "hash_raw": fw["hash"], - "size": fw["size"], - "sparse": False, - "full_check": True, - "has_ab": True, - }) + files = [ + process_file(OUTPUT_DIR / "boot.img", "boot"), + process_file(OUTPUT_DIR / "system.img", "system", full_check=False), + ] + for fw in ("xbl", "abl", "xbl_config", "devcfg", "aop"): + # firmware not built in this repo + files.append(process_file(FIRMWARE_DIR / f"{fw}.bin", fw)) configs = [ (AGNOS_UPDATE_URL, "ota.json"),