From d1d94a5e5a1c2ab81d4857931ad9e48816ab4971 Mon Sep 17 00:00:00 2001 From: Alice Ferrazzi Date: Thu, 13 Jul 2017 08:18:24 +0000 Subject: [PATCH] added output argument for choose where to save the livepatch file --- kpatch-build/kpatch-build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 24b41c9..569a6dc 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -241,13 +241,14 @@ usage() { echo " -c, --config Specify kernel config file" >&2 echo " -v, --vmlinux Specify original vmlinux" >&2 echo " -t, --target Specify custom kernel build targets" >&2 + echo " -o, --output Specify output folder" >&2 echo " -d, --debug Keep scratch files in /tmp" >&2 echo " --skip-cleanup Skip post-build cleanup" >&2 echo " --skip-gcc-check Skip gcc version matching check" >&2 echo " (not recommended)" >&2 } -options=$(getopt -o hr:s:c:v:t:d -l "help,sourcerpm:,sourcedir:,config:,vmlinux:,target:,debug,skip-gcc-check,skip-cleanup" -- "$@") || die "getopt failed" +options=$(getopt -o hr:s:c:v:t:o:d -l "help,sourcerpm:,sourcedir:,config:,vmlinux:,target:,output:,debug,skip-gcc-check,skip-cleanup" -- "$@") || die "getopt failed" eval set -- "$options" @@ -284,6 +285,11 @@ while [[ $# -gt 0 ]]; do TARGETS="$TARGETS $2" shift ;; + -o|--output) + BASE=$(readlink -f "$2") + shift + [[ ! -d "$BASE" ]] && die "output dir $BASE not found" + ;; -d|--debug) echo "DEBUG mode enabled" DEBUG=1