From c9fbac1f3440e05d8b03cdc44c9e6f8f35f35486 Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Tue, 3 Mar 2026 17:11:45 -0800 Subject: [PATCH] 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 Link: https://github.com/openwrt/openwrt/pull/22264 Signed-off-by: Robert Marko --- scripts/json_overview_image_info.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index 96921c2743..fe476e10fa 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -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")