mirror of https://github.com/dynup/kpatch
Merge pull request #1407 from wardenjohn/add_version_show
kpatch-build: introduce version print option
This commit is contained in:
commit
34102d0058
|
@ -33,6 +33,7 @@
|
||||||
# - Builds the patched kernel/module and monitors changed objects
|
# - Builds the patched kernel/module and monitors changed objects
|
||||||
# - Builds the patched objects with gcc flags -f[function|data]-sections
|
# - Builds the patched objects with gcc flags -f[function|data]-sections
|
||||||
# - Runs kpatch tools to create and link the patch kernel module
|
# - Runs kpatch tools to create and link the patch kernel module
|
||||||
|
VERSION=0.9.9
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
@ -733,13 +734,14 @@ usage() {
|
||||||
echo " --skip-cleanup Skip post-build cleanup" >&2
|
echo " --skip-cleanup Skip post-build cleanup" >&2
|
||||||
echo " --skip-compiler-check Skip compiler version matching check" >&2
|
echo " --skip-compiler-check Skip compiler version matching check" >&2
|
||||||
echo " (not recommended)" >&2
|
echo " (not recommended)" >&2
|
||||||
|
echo " --version Version of kpatch-build"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! command -v gawk &> /dev/null; then
|
if ! command -v gawk &> /dev/null; then
|
||||||
die "gawk not installed"
|
die "gawk not installed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace" -- "$@")" || die "getopt failed"
|
options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,version" -- "$@")" || die "getopt failed"
|
||||||
|
|
||||||
eval set -- "$options"
|
eval set -- "$options"
|
||||||
|
|
||||||
|
@ -821,6 +823,10 @@ while [[ $# -gt 0 ]]; do
|
||||||
echo "WARNING: Skipping compiler version matching check (not recommended)"
|
echo "WARNING: Skipping compiler version matching check (not recommended)"
|
||||||
SKIPCOMPILERCHECK=1
|
SKIPCOMPILERCHECK=1
|
||||||
;;
|
;;
|
||||||
|
--version)
|
||||||
|
echo "Version : $VERSION"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
[[ "$1" = "--" ]] && shift && continue
|
[[ "$1" = "--" ]] && shift && continue
|
||||||
[[ ! -f "$1" ]] && die "patch file '$1' not found"
|
[[ ! -f "$1" ]] && die "patch file '$1' not found"
|
||||||
|
|
Loading…
Reference in New Issue