mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-08-06 16:55:45 +08:00
remove system-skip-chunks alt image (#367)
This commit is contained in:
@@ -41,12 +41,6 @@ process_file() {
|
||||
local HASH_RAW=$(cat $OTA_JSON | jq -r ".[] | select(.name == \"$NAME\") | .hash_raw")
|
||||
upload_file "$NAME-$HASH_RAW.img.xz"
|
||||
|
||||
local ALT_URL=$(cat $OTA_JSON | jq -r ".[] | select(.name == \"$NAME\") | .alt.url")
|
||||
if [ "$ALT_URL" != "null" ]; then
|
||||
local ALT_FILE_NAME=$(basename $ALT_URL)
|
||||
upload_file $ALT_FILE_NAME
|
||||
fi
|
||||
|
||||
# if [ "$NAME" == "system" ]; then
|
||||
# local CAIBX_FILE_NAME="system-$HASH_RAW.caibx"
|
||||
# local CHUNKS_FOLDER="system-$HASH_RAW"
|
||||
|
||||
+2
-20
@@ -26,7 +26,7 @@ def compress(fin, fout) -> None:
|
||||
subprocess.check_call(f"xz -T4 -vc {fin} > {fout}", shell=True)
|
||||
|
||||
|
||||
def process_file(fn, name, full_check=True, has_ab=True, alt=None):
|
||||
def process_file(fn, name, full_check=True, has_ab=True):
|
||||
print(name)
|
||||
hash_raw = hash = checksum(fn)
|
||||
size = fn.stat().st_size
|
||||
@@ -47,22 +47,6 @@ def process_file(fn, name, full_check=True, has_ab=True, alt=None):
|
||||
"has_ab": has_ab,
|
||||
}
|
||||
|
||||
if alt is not None:
|
||||
print(" calculating alt")
|
||||
alt_hash = checksum(alt)
|
||||
alt_size = alt.stat().st_size
|
||||
print(f" {alt_size} bytes, hash {alt_hash} (alt)")
|
||||
|
||||
print(" compressing alt")
|
||||
alt_xz_fn = OTA_OUTPUT_DIR / f"{alt.stem}-{hash_raw}.img.xz"
|
||||
compress(alt, alt_xz_fn)
|
||||
|
||||
ret["alt"] = {
|
||||
"hash": alt_hash,
|
||||
"url": "{remote_url}/" + alt_xz_fn.name,
|
||||
"size": alt_size,
|
||||
}
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@@ -74,7 +58,7 @@ if __name__ == "__main__":
|
||||
else:
|
||||
files = [
|
||||
process_file(OUTPUT_DIR / "boot.img", "boot"),
|
||||
process_file(OUTPUT_DIR / "system.img", "system", full_check=False, alt=OUTPUT_DIR / "system-skip-chunks.img"),
|
||||
process_file(OUTPUT_DIR / "system.img", "system", full_check=False),
|
||||
]
|
||||
|
||||
# pull in firmware not built in this repo
|
||||
@@ -100,8 +84,6 @@ if __name__ == "__main__":
|
||||
processed_files = []
|
||||
for f in deepcopy(files):
|
||||
f["url"] = f["url"].format(remote_url=remote_url)
|
||||
if "alt" in f:
|
||||
f["alt"]["url"] = f["alt"]["url"].format(remote_url=remote_url)
|
||||
processed_files.append(f)
|
||||
|
||||
with open(OTA_OUTPUT_DIR / output_fn, "w") as out:
|
||||
|
||||
+1
-3
@@ -20,9 +20,8 @@ cd $OUTPUT_DIR
|
||||
|
||||
download_image() {
|
||||
local name=$1
|
||||
local alt=${2:-""}
|
||||
|
||||
local url=$(cat $OTA_JSON | jq -r ".[] | select(.name == \"$name\") | $alt.url")
|
||||
local url=$(cat $OTA_JSON | jq -r ".[] | select(.name == \"$name\") | .url")
|
||||
if [ "$url" == "null" ]; then
|
||||
return
|
||||
fi
|
||||
@@ -37,7 +36,6 @@ download_image() {
|
||||
|
||||
for name in boot system; do
|
||||
download_image $name
|
||||
download_image $name ".alt"
|
||||
done
|
||||
|
||||
echo "Done!"
|
||||
|
||||
Reference in New Issue
Block a user