Files

13 lines
339 B
Bash
Raw Permalink Normal View History

2024-01-17 22:30:49 -03:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Script to generate the module version header
#
if command -v git >/dev/null 2>&1 && [ -d .git ]; then
2024-01-17 22:30:49 -03:00
GIT_COMMIT=$(git describe HEAD | tail -c 9)
else
GIT_COMMIT="$(grep PACKAGE_VERSION dkms.conf | cut -d '"' -f2)?"
2024-01-17 22:30:49 -03:00
fi
printf '#define GIT_COMMIT\t"%s"\n' "$GIT_COMMIT" > version.h