summaryrefslogtreecommitdiffstats
path: root/scripts/json_overview_image_info.py
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2020-06-30 01:02:43 -1000
committerDaniel Golle <daniel@makrotopia.org>2020-06-30 23:21:10 +0100
commit263f7e5bbd119ebed1f514c16f659a2e2a2b132c (patch)
treeb50da617aefe789d22d9de6f1a23913705771875 /scripts/json_overview_image_info.py
parentd4c80f5b172e3e3a209fdd64c73be535e360db34 (diff)
downloadopenwrt-263f7e5bbd119ebed1f514c16f659a2e2a2b132c.tar.gz
openwrt-263f7e5bbd119ebed1f514c16f659a2e2a2b132c.tar.bz2
openwrt-263f7e5bbd119ebed1f514c16f659a2e2a2b132c.zip
build: store default/device packages in JSON
With this commit the `profiles.json` contain both the target specific `default_packages` as well as the device specific `device_packages` as a array of strings. This information is required for downstream projects like the various web-based interactive firmware generators. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'scripts/json_overview_image_info.py')
-rwxr-xr-xscripts/json_overview_image_info.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index a1418e366d..59d69df314 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
-import json
+from os import getenv, environ
from pathlib import Path
-from os import getenv
+from subprocess import run
from sys import argv
+import json
if len(argv) != 2:
print("JSON info files script requires ouput file as argument")
@@ -31,6 +32,21 @@ for json_file in work_dir.glob("*.json"):
image_info["profiles"][device_id]["images"][0]
)
+
+output["default_packages"] = run(
+ [
+ "make",
+ "--no-print-directory",
+ "-C",
+ f"target/linux/{output['target'].split('/')[0]}",
+ "val.DEFAULT_PACKAGES",
+ ],
+ capture_output=True,
+ check=True,
+ env=environ.copy().update({"TOPDIR": Path().cwd()}),
+ text=True,
+).stdout.split()
+
if output:
output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
else: