Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package_ota: remove converting sparse to raw #289

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions scripts/package_ota.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ 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:
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
else:
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)")
with NamedTemporaryFile() as tmp_f:
subprocess.check_call(["simg2img", fn, tmp_f.name])
hash_raw = checksum(tmp_f.name)
andiradulescu marked this conversation as resolved.
Show resolved Hide resolved
size = Path(tmp_f.name).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"
Expand Down