Skip to content

Commit

Permalink
build: detect if image was to big
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Apr 1, 2024
1 parent 6ce5023 commit e6125ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions asu/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ def build(req: dict, job=None):

job.save_meta()

if any(err in job.meta["stderr"] for err in ["is too big", "out of space?"]):
report_error(job, "Selected packages exceed device storage")

if returncode:
report_error(job, "Error while building firmware. See stdout/stderr")

if "is too big" in job.meta["stderr"]:
report_error(job, "Selected packages exceed device storage")

json_file = store_path / bin_dir / "profiles.json"

if not json_file.is_file():
Expand Down
17 changes: 11 additions & 6 deletions asu/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,17 @@ def run_container(

logging.debug(f"Copied {container_tar} to {host_tar}")

unpack_archive(
host_tar.name,
copy[1],
"tar",
)
logging.debug(f"Unpacked {host_tar} to {copy[1]}")
# check if the tar is empty
if host_tar.tell():
unpack_archive(
host_tar.name,
copy[1],
"tar",
)
logging.debug(f"Unpacked {host_tar} to {copy[1]}")
else:
logging.warning(f"Empty tar: {host_tar}")
returncode = 1

host_tar.close()
logging.debug(f"Closed {host_tar}")
Expand Down

0 comments on commit e6125ef

Please sign in to comment.