mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-04-06 06:43:53 +08:00
package_ota: remove converting sparse to raw (#289)
* package_ota: don't convert sparse image to raw if raw images already exists * don't convert anymore
This commit is contained in:
1
.github/workflows/build.yaml
vendored
1
.github/workflows/build.yaml
vendored
@@ -69,7 +69,6 @@ jobs:
|
||||
env:
|
||||
AGNOS_UPDATE_URL: https://raw.githubusercontent.com/commaai/ci-artifacts/agnos-builder/pr-${{ github.event.number }}/
|
||||
run: |
|
||||
sudo apt-get install -y android-sdk-libsparse-utils
|
||||
scripts/package_ota.py
|
||||
|
||||
- name: Copy and push boot, system and agnos.json
|
||||
|
||||
@@ -5,7 +5,6 @@ import hashlib
|
||||
import subprocess
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
ROOT = Path(__file__).parent.parent
|
||||
OUTPUT_DIR = ROOT / "output"
|
||||
@@ -32,12 +31,12 @@ def process_file(fn, name, sparse=False, full_check=True, has_ab=True, alt=None)
|
||||
print(f" {size} bytes, hash {hash}")
|
||||
|
||||
if sparse:
|
||||
with NamedTemporaryFile() as tmp_f:
|
||||
print(" converting sparse image to raw")
|
||||
subprocess.check_call(["simg2img", fn, tmp_f.name])
|
||||
hash_raw = checksum(tmp_f.name)
|
||||
size = Path(tmp_f.name).stat().st_size
|
||||
print(f" {size} bytes, hash {hash} (raw)")
|
||||
raw_img = OUTPUT_DIR / "system.raw.img"
|
||||
if raw_img.exists():
|
||||
print(" using existing raw image")
|
||||
hash_raw = checksum(raw_img)
|
||||
size = raw_img.stat().st_size
|
||||
print(f" {size} bytes, hash {hash_raw} (raw)")
|
||||
|
||||
print(" compressing")
|
||||
xz_fn = OTA_OUTPUT_DIR / f"{fn.stem}-{hash_raw}.img.xz"
|
||||
|
||||
Reference in New Issue
Block a user