This script helps generate the perf-man tarball. By default it uses the kernel version of the upstream tree set in LINUX_GIT. In the given case the the upstream tree and the current tree do not have the same version use the --version=x.y
Signed-off-by: Miguel Flores Silverio floresmigu3l@gmail.com ---
* v1 - use LINUX_GIT * v2 - Fix: quotes around $LINUX - moves to scripts directory * v3 - Add prompt to specify kernel version and patchlevel. * v4 - Use flag --version=x.y instead of prompt - Remove debuggin comments
scripts/generate-perf-man.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/generate-perf-man.sh
diff --git a/scripts/generate-perf-man.sh b/scripts/generate-perf-man.sh new file mode 100755 index 0000000..6f51820 --- /dev/null +++ b/scripts/generate-perf-man.sh @@ -0,0 +1,44 @@ +#! /bin/sh +# Small script to generate the perf-man tarball. The script relies on having +# LINUX_GIT set in your local .bashrc. By default the script will use the +# the kernel version of the upstream tree set in LINUX_GIT. Use --version=x.y +# to set a specific version. + +# [Default] eg. ./scritps/generate-perf-man +# eg. ./scripts/generate-perf-man --version=4.8 + +if [ -f ~/.bashrc ]; then + source ~/.bashrc +fi + +if [ ! -d "$LINUX_GIT" ]; then + echo "Error: $LINUX_GIT is not set to the upstream git tree." + exit 1 +fi + +BASEDIR=$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)") +pushd "$LINUX_GIT" +KERNEL_VERSION=$( awk '/^VERSION =/ {print $3}' Makefile ) +KERNEL_PATCHLEVEL=$( awk '/^PATCHLEVEL =/ {print $3}' Makefile ) + +if [ ! -z "$@" ]; then + for opt in "$@"; do + case $opt in + --version=*.*) + version="${opt#*=}" + KERNEL_VERSION=$( awk -F. '{print $1}' <<< $version ) + KERNEL_PATCHLEVEL=$( awk -F. '{print $2}' <<< $version ) + ;; + -h | --help) + usage + ;; + *) + ;; + esac + done +fi +cd tools/perf/Documentation/ +make +tar -czvf $BASEDIR/perf-man-${KERNEL_VERSION}.${KERNEL_PATCHLEVEL}.tar.gz *.1 +make clean +popd -- 2.7.4