scripts: add git_commit to profiles.json

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>
This commit is contained in:
Paul Spooren
2026-04-20 19:46:13 +08:00
parent 445488e8b8
commit a36edd2b32
+10 -1
View File
@@ -2,7 +2,7 @@
from os import getenv, environ from os import getenv, environ
from pathlib import Path from pathlib import Path
from subprocess import run, PIPE from subprocess import run, PIPE, DEVNULL
from sys import argv from sys import argv
import json import json
import re import re
@@ -92,6 +92,15 @@ if output:
"vermagic": linux_vermagic, "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": for artifact in "imagebuilder", "sdk", "toolchain":
filename = add_artifact(artifact) filename = add_artifact(artifact)
add_artifact("llvm-bpf", prefix="") add_artifact("llvm-bpf", prefix="")