Skip to content

Commit

Permalink
build: profiles.json: add kernel version information
Browse files Browse the repository at this point in the history
Currently downstream tools like ASU lack information about kernel
version to find out the relevant kmod build folder on downloads server.

So lets fix it by providing a new `linux_kernel` JSON array which would
for the start provide Linux kernel version, revision and vermagic
information.

  "linux_kernel": {
     "release": "1",
     "vermagic": "b57450c07d3a786158c3601fc5cee57d",
     "version": "6.6.61"
   },

Fixes: openwrt#17036
Fixes: efahl/owut#9
Co-developed-by: Petr Štetiar <[email protected]>
Signed-off-by: Eric Fahlgren <[email protected]>
Link: openwrt#17042
Signed-off-by: Petr Štetiar <[email protected]>
(cherry picked from commit c857145)
  • Loading branch information
efahl authored and Ansuel committed Nov 29, 2024
1 parent 6d5c434 commit db554fd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/json_overview_image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,23 @@ def get_initial_output(image_info):


if output:
default_packages, output["arch_packages"] = run(
(
default_packages,
output["arch_packages"],
linux_version,
linux_release,
linux_vermagic,
) = run(
[
"make",
"--no-print-directory",
"-C",
"target/linux/",
"val.DEFAULT_PACKAGES",
"val.ARCH_PACKAGES",
"val.LINUX_VERSION",
"val.LINUX_RELEASE",
"val.LINUX_VERMAGIC",
"V=s",
],
stdout=PIPE,
Expand All @@ -64,7 +73,11 @@ def get_initial_output(image_info):
).stdout.splitlines()

output["default_packages"] = sorted(default_packages.split())

output["linux_kernel"] = {
"version": linux_version,
"release": linux_release,
"vermagic": linux_vermagic,
}
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")

0 comments on commit db554fd

Please sign in to comment.