]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
scripts: add git_commit to profiles.json
authorPaul Spooren <mail@aparcar.org>
Mon, 20 Apr 2026 11:46:13 +0000 (19:46 +0800)
committerPaul Spooren <mail@aparcar.org>
Tue, 21 Apr 2026 11:47:58 +0000 (19:47 +0800)
Right now we only have the special getver.sh output (i.e. r32802-f505120278)
instead of the actual, full git hash. Offer the full hash for downstream
tooling, specifically the KernelCI.

Signed-off-by: Paul Spooren <mail@aparcar.org>
scripts/json_overview_image_info.py

index 0449bb56d7ee52181a56f6a28b26b2e209aee511..08838729daa058c1b33c6d5272c214d61f05c475 100755 (executable)
@@ -2,7 +2,7 @@
 
 from os import getenv, environ
 from pathlib import Path
-from subprocess import run, PIPE
+from subprocess import run, PIPE, DEVNULL
 from sys import argv
 import json
 import re
@@ -92,6 +92,15 @@ if output:
         "vermagic": linux_vermagic,
     }
 
+    git_commit = run(
+        ["git", "rev-parse", "HEAD"],
+        stdout=PIPE,
+        stderr=DEVNULL,
+        universal_newlines=True,
+    )
+    if git_commit.returncode == 0:
+        output["git_commit"] = git_commit.stdout.strip()
+
     for artifact in "imagebuilder", "sdk", "toolchain":
         filename = add_artifact(artifact)
     add_artifact("llvm-bpf", prefix="")