kernel-tag.zsh: Add script to determine if a commit is tagged
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
9b07caada6
commit
b02e2ee03d
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
# Note: Set CONFIG_LOCALVERSION with
|
||||||
|
# REV=$(git rev-parse --short HEAD)$(git diff --quiet || echo "-dirty")
|
||||||
|
# scripts/config --set-str CONFIG_LOCALVERSION "-g$REV"
|
||||||
|
|
||||||
|
SOURCE=/home/anna/Programs/linux-nfs.git/
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 {remote host}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
vm.zsh boot $1
|
||||||
|
|
||||||
|
uname=$(ssh $1 uname -r)
|
||||||
|
config=$(ssh $1 zcat /proc/config.gz | grep -E "# Linux(.*?)Kernel Configuration$" | awk '{print $3}')
|
||||||
|
last=$(echo $uname | awk -F- '{print $NF}')
|
||||||
|
|
||||||
|
# Check for a distro kernel
|
||||||
|
if [ "$uname" = "$config-1" ]; then
|
||||||
|
echo "v$config"
|
||||||
|
elif [ "${last[0,1]}" = "g" ]; then
|
||||||
|
cd $SOURCE && git describe --exact-match "${last:1}" 2>/dev/null || exit 0
|
||||||
|
fi
|
Loading…
Reference in New Issue