build: include build artifacts in profiles.json

In order to reduce the need for html scraping, add the imagebuilder,
sdk, build toolchain and llvm-bpf toolchain file names to profiles.json.

Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22264
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Eric Fahlgren 2026-03-03 17:11:45 -08:00 committed by Robert Marko
parent dddda85985
commit c9fbac1f34

View file

@ -11,6 +11,7 @@ if len(argv) != 2:
exit(1)
output_path = Path(argv[1])
output_dir = output_path.parent
assert getenv("WORK_DIR"), "$WORK_DIR required"
@ -28,6 +29,12 @@ def get_initial_output(image_info):
return image_info
def add_artifact(artifact, prefix="openwrt-"):
files = list(output_dir.glob(f"{prefix}{artifact}-*"))
if len(files) == 1:
output[artifact] = str(files[0].name)
for json_file in work_dir.glob("*.json"):
image_info = json.loads(json_file.read_text())
@ -78,6 +85,11 @@ if output:
"release": linux_release,
"vermagic": linux_vermagic,
}
for artifact in "imagebuilder", "sdk", "toolchain":
filename = add_artifact(artifact)
add_artifact("llvm-bpf", prefix="")
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
else:
print("JSON info file script could not find any JSON files for target")