common/post-build: Use infix's version, not buildroot's, in os-release

This way we can more easily know exactly from which commit an image
was built.
This commit is contained in:
Tobias Waldekranz
2022-09-27 16:02:20 +02:00
parent 878e46c3f9
commit 2bffa52be3
+5 -3
View File
@@ -1,15 +1,17 @@
#!/bin/sh
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
# This is a symlink to /usr/lib/os-release, so we remove this to keep
# original Buildroot information.
rm "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"Inf/IX\""
echo "VERSION=${BR2_VERSION}"
echo "VERSION=${GIT_VERSION}"
echo "ID=infix"
echo "VERSION_ID=${BR2_VERSION}"
echo "VERSION_ID=${GIT_VERSION}"
echo "PRETTY_NAME=\"Inf/IX by KernelKit\""
echo "HOME_URL=https://github.com/KernelKit"
} > "$TARGET_DIR/etc/os-release"
echo "Inf/IX by KernelKit $BR2_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
echo "Inf/IX by KernelKit $GIT_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"