mirror of
https://github.com/meizu-m86/kexec-tools-arm64
synced 2025-11-03 21:42:16 +08:00
debugging: Add version
This commit is contained in:
31
bootstrap
31
bootstrap
@@ -19,6 +19,37 @@
|
||||
## @start 1
|
||||
#! /bin/sh
|
||||
|
||||
version=
|
||||
|
||||
if [ "$1" ]; then
|
||||
version=$1
|
||||
elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
|
||||
|
||||
# If available, use the git commit revision for the package version.
|
||||
|
||||
# Add a date prefix for easy reading.
|
||||
# date='2010-11-30 16:36:09 -0800'
|
||||
|
||||
date=$(git log --pretty=format:"%ci" -1 HEAD)
|
||||
date=${date##20}
|
||||
date=${date%%:[0-9][0-9] *}
|
||||
date=$(echo ${date} | sed -e 's/[- :]/./g')
|
||||
|
||||
version=$(printf '%s-%s%s' ${date} g ${head})
|
||||
|
||||
# Add a '-dirty' postfix for uncommitted changes.
|
||||
|
||||
if git diff-index HEAD | read dummy; then
|
||||
version=`printf '%s%s' ${version} -dirty`
|
||||
fi
|
||||
else
|
||||
# Default to current date and time.
|
||||
|
||||
version="unknown-$(date +%y.%m.%d-%H.%M.%S)"
|
||||
fi
|
||||
|
||||
echo "#define VERSION \"${version}\"" > version.h
|
||||
|
||||
set -x
|
||||
aclocal -I config
|
||||
autoheader
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "kexec-zlib.h"
|
||||
#include "kexec-lzma.h"
|
||||
#include <arch/options.h>
|
||||
#include "../version.h"
|
||||
|
||||
unsigned long long mem_min = 0;
|
||||
unsigned long long mem_max = ULONG_MAX;
|
||||
@@ -1216,6 +1217,8 @@ int main(int argc, char *argv[])
|
||||
};
|
||||
static const char short_options[] = KEXEC_ALL_OPT_STR;
|
||||
|
||||
printf("kexec version: " VERSION "\n");
|
||||
|
||||
/*
|
||||
* First check if --use-kexec-file-syscall is set. That changes lot of
|
||||
* things
|
||||
|
||||
Reference in New Issue
Block a user