mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-08-23 09:13:50 +08:00
Ship non-sparse system image in OTA (#275)
* removed system-skip-chunks image
* removed sparsed system.img
* clean github workflow
* copy image to output
* fake system-skip-chunks [upload]
* sparse key must exist otherwise KeyError: 'sparse' in openpilot
* reduce image size to 5G otherwise MemoryError: Unable to allocate output buffer. in openpilot
* [upload]
* Revert "fake system-skip-chunks"
This reverts commit bcd11e7e32.
* recreate 10G image [upload]
* resize2fs
* resize2fs shrink image
* revert skip-chunks image
* cleanup
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
|
||||
# sudo apt install ncdu
|
||||
|
||||
sudo mount build/system.img.raw build/agnos-rootfs
|
||||
sudo mount build/system.img build/agnos-rootfs
|
||||
sudo ncdu build/agnos-rootfs/ || true
|
||||
sudo umount build/agnos-rootfs
|
||||
|
||||
+3
-14
@@ -25,23 +25,12 @@ def compress(fin, fout) -> None:
|
||||
subprocess.check_call(f"xz -T4 -vc {fin} > {fout}", shell=True)
|
||||
|
||||
|
||||
def process_file(fn, name, sparse=False, full_check=True, has_ab=True, alt=None):
|
||||
def process_file(fn, name, full_check=True, has_ab=True, alt=None):
|
||||
print(name)
|
||||
hash_raw = hash = checksum(fn)
|
||||
size = fn.stat().st_size
|
||||
print(f" {size} bytes, hash {hash}")
|
||||
|
||||
if sparse:
|
||||
raw_img = BUILD_DIR / "system.img.raw"
|
||||
if raw_img.exists():
|
||||
print(" using existing raw image")
|
||||
hash_raw = checksum(raw_img)
|
||||
size = raw_img.stat().st_size
|
||||
else:
|
||||
print("Error: existing raw image not found")
|
||||
exit(1)
|
||||
print(f" {size} bytes, hash {hash_raw} (raw)")
|
||||
|
||||
print(" compressing")
|
||||
xz_fn = OTA_OUTPUT_DIR / f"{fn.stem}-{hash_raw}.img.xz"
|
||||
compress(fn, xz_fn)
|
||||
@@ -52,7 +41,7 @@ def process_file(fn, name, sparse=False, full_check=True, has_ab=True, alt=None)
|
||||
"hash": hash,
|
||||
"hash_raw": hash_raw,
|
||||
"size": size,
|
||||
"sparse": sparse,
|
||||
"sparse": False,
|
||||
"full_check": full_check,
|
||||
"has_ab": has_ab,
|
||||
}
|
||||
@@ -81,7 +70,7 @@ if __name__ == "__main__":
|
||||
|
||||
files = [
|
||||
process_file(OUTPUT_DIR / "boot.img", "boot"),
|
||||
process_file(OUTPUT_DIR / "system.img", "system", sparse=True, full_check=False, alt=OUTPUT_DIR / "system-skip-chunks.img"),
|
||||
process_file(OUTPUT_DIR / "system.img", "system", full_check=False, alt=OUTPUT_DIR / "system-skip-chunks.img"),
|
||||
]
|
||||
configs = [
|
||||
(AGNOS_UPDATE_URL, "ota.json"),
|
||||
|
||||
@@ -10,6 +10,7 @@ if [ ! -f /AGNOS ]; then
|
||||
fi
|
||||
|
||||
sudo mount -o rw,remount /
|
||||
sudo resize2fs $(findmnt -n -o SOURCE /)
|
||||
|
||||
echo "symlink /usr/comma"
|
||||
sudo rm -rf /usr/comma
|
||||
|
||||
Reference in New Issue
Block a user