Răsfoiți Sursa

build: profiles.json: add kernel version information

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/openwrt#17036
Fixes: efahl/owut#9
Co-developed-by: Petr Štetiar <[email protected]>
Signed-off-by: Eric Fahlgren <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/17042
Signed-off-by: Petr Štetiar <[email protected]>
Eric Fahlgren 1 an în urmă
părinte
comite
c857145e03
1 a modificat fișierele cu 15 adăugiri și 2 ștergeri
  1. 15 2
      scripts/json_overview_image_info.py

+ 15 - 2
scripts/json_overview_image_info.py

@@ -47,7 +47,13 @@ for device_id, profile in output.get("profiles", {}).items():
 
 
 
 
 if output:
 if output:
-    default_packages, output["arch_packages"] = run(
+    (
+        default_packages,
+        output["arch_packages"],
+        linux_version,
+        linux_release,
+        linux_vermagic,
+    ) = run(
         [
         [
             "make",
             "make",
             "--no-print-directory",
             "--no-print-directory",
@@ -55,6 +61,9 @@ if output:
             "target/linux/",
             "target/linux/",
             "val.DEFAULT_PACKAGES",
             "val.DEFAULT_PACKAGES",
             "val.ARCH_PACKAGES",
             "val.ARCH_PACKAGES",
+            "val.LINUX_VERSION",
+            "val.LINUX_RELEASE",
+            "val.LINUX_VERMAGIC",
             "V=s",
             "V=s",
         ],
         ],
         stdout=PIPE,
         stdout=PIPE,
@@ -64,7 +73,11 @@ if output:
     ).stdout.splitlines()
     ).stdout.splitlines()
 
 
     output["default_packages"] = sorted(default_packages.split())
     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=(",", ":")))
     output_path.write_text(json.dumps(output, sort_keys=True, separators=(",", ":")))
 else:
 else:
     print("JSON info file script could not find any JSON files for target")
     print("JSON info file script could not find any JSON files for target")